# Generating code blocks with datacore

**URL:** <https://forum.obsidian.md/t/generating-code-blocks-with-datacore/112982>\
**Category:** Help\
**Created:** [April 2, 2026, 7:12pm UTC](https://forum.obsidian.md/t/generating-code-blocks-with-datacore/112982 "2026-04-02T19:12:31Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bagnisurza](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/b/e47c2d/32.png) [@bagnisurza](https://forum.obsidian.md/u/bagnisurza)\
**Post date:** [May 5, 2026, 2:31pm UTC](https://forum.obsidian.md/t/generating-code-blocks-with-datacore/112982/2 "2026-05-05T14:31:40Z")

</div>

As an alternative, I am also attempting to load a QRcode library into dataview using require. It sounds like this was possible in 2021:

> [@DataviewJs - Code reuse: common place for scripts](https://forum.obsidian.md/t/dataviewjs-code-reuse-common-place-for-scripts/18611/5):
>
> I have looong DataviewJs Codeblocks with functions like function printTable(todolist, name, captionLevel=2) { function AddMyPropertiesToDataviewPageObject(page) { function GetAllContainedProjectTags(pages) { to make my own calculations, filters and compilations of my tasks. These functions are called on every run and create my task tables. So the javascript functions have to be called on every task update.

However, testing this I receive an error:

ReferenceError: require is not defined

2021 was some time ago. Is it currently possible to import js files into dataviewjs? I may also look to see if something similar is possible with datacore.

---

_[View the full topic](https://forum.obsidian.md/t/generating-code-blocks-with-datacore/112982)._
