I have a module which takes a few input queries as parameters. I'd like to provide the user with an indication that the queries are running, as in Can I display an alert/notification WHILE a query is running?.
.isFetching attribute of the query when referenced within the module does not match the
.isFetching attribute of the query when referenced outside the module in the parent app where it is used. In particular, within the module the duration of
isFetching is much shorter than outside the module.
How can I accurately see the progress of a module input query from within the module itself? Is there any documentation available about module input queries?
To test this, I added an alert within both the module and the parent app visible only when the query in question
.isFetching. The alert within the module "flickers", appearing briefly before disappearing again, whereas the alert within the parent app is present for the entire time the query passed into the module is running.
Hi @heidi-pachama, I was able to reproduce this issue. I looked into it and unfortunately, when we use an input query that is set outside of the module, it is possible to keep track of the query runtime form the parent app, but not from the module itself. The reason is that, within the module:
The "Resource" is a reference to what will be assigned
The data for it ("input1.data") will be assigned when the query selected, and triggered on the parent app, is done running. Which means that for the time that is running, its value is 'undefined.' Because the assignment happens when the query on the parent app is done running, "input1.isFetching" always evaluates to false, unless we trigger the query again while the previous run is still going. This stops the previous run, and "input1.isFetching" evaluates to true for a millisecond.
Module input query - data value (video)
The only workaround is to show the notification from the parent app that is using the module, we would need to repeat this process on every app that uses it. Unless the query is assigned within the module, then the "isFetching" property does evaluate to true while the selected query is running.
There is currently a request for our Engineering Team to reevaluate how a query assigned from the parent app is referenced within the module. I'll let you know if there are any updates on it.