Category: How do I do X?


This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord. is not a function


I am having trouble using a JavaScript function to provide data for my page widget. When I use a SQL query, it works fine, but when I use my function, I get an error saying that the function is not recognized. I have tried removing the function call and it works, but I need to be able to use my function for added logic. Can someone please help me with this issue?


The issue described involves using a JavaScript object to provide data for a page widget instead of using an SQL query. However, when the JS function is used in the context of table data, there is an error indicating that is not a function.

To resolve this issue, it is recommended to use {{}} in the TableData property. This syntax allows the response of the async function to be used in a sync field. An example code snippet that demonstrates this solution is provided below:

import { select_query } from "./data.js";export default {    load: async () => {        await;        return;    }}// Use {{}} in the TableData property

Note that the load function is marked as async and uses await to wait for the data to be fetched before returning it. This may help ensure that the data is properly loaded before it is used in the table.