Query successful, but table not populating with data?


I have a query that makes a GET request to our API. I am using this query to get data to populate a table. The request completes successfully, and I am able to see that the data property has the expected data, but the table is not populating. What am I missing?

It's possible the data needs to be formatted as an Object?
Enable Transformer in the same window where your query is written and
return formatDataAsObject(data)

Or you can try wrapping {{getStockSymbols.data}} in [ ] like

Difficult to give you the right answer without seeing the actual query response...

Thanks for the quick response @ScottR!!

The query response looks like an array of objects.

When I tried wrapping it in an array the page timed out, and formatting the data as an object with a transformer worked initially, but when I filter the data and remove the filters the table fails to populate again even though I see the data is there

Are you filtering directly in the table itself or in some other way? What does the table look like before filtering and after filtering?

I am filtering the table indirectly. I have a text input that has "on change" event handlers. One to add a filter based on the column "symbol" or "name", and another that clears the filters if the input field is empty. I also added an on change event handler to call the getStockSymbols query in attempt to re-populate the table, but to no avail...

OK all of those event handlers will fire based on Only run when... I suspect one of them is breaking the table or the events are firing all at once... I would test each Event handler one at a time to see where the problem exists. - I have never used that functionality before so I can't suggest if the filter itself is correct or not.. sorry

Thanks for your help! I think I'll rely on the filtering functionality on the table component itself instead.

Please post if you find the solution....good luck

I have the same issue, does anyone knows how to solve it?

Hey @andresdigible,

Sorry about the late reply here, are you still having this same issue? Is it particularly when clearing filters and using the Filter mode "Or"?

There's a particular issue our dev team is aware of there and should be addressed with upcoming changes to table filtering. In the meantime, you can try using table.setFilters([], 'and') as a workaround or the following event handler:

Let me know if that helps!

Please help early query is working fine, but suddenly on an important release, it fails. What's this issue in retool.

I am running this query on page load, then it is not rendering in table , otherwise, on again runing query on manual click it is rendering.

What's the suddenly raised issue only on page load.

Hey @ishi8!

For some context, it might help if we can take a look at your query when it's failing. Would you mind posting screenshots of the query itself from the editor mode when it first fails to run? Seeing how the query is set up can really help, same with any error messages you might be seeing. It can also be helpful to check your browser console for any other error messages that might show up there.

A post was split to a new topic: JS Query returning data, but not auto populating into table