Queryname.run() is not a function

Hello,

I am using a custom column in a Table with Computed Value as a function I’ve created in a JSObject.

The function runs a query with filter to get only selected rows and perform action (calculate total of queried rows) and return the total.

I’m getting the error Queryname.run() is not a function.
image

If I make the function async, the error disappears but the computed value is undefined.

@innomalous to access a function in the same file, you can use the this keyword
So
this.FetchChildItems.data should work

Hello,

Getting the same error while trying to run a query from a JSObject.

Here’s how the API query is setup:

I’m trying to pass params in the following code:
image

But getting the error:
image

I’m following the instructions given here: Query - Appsmith

Can someone please suggest what am I missing?

The issue gets solved when using a for loop instead of the forEach() method.