I don't believe this is possible... what is your use case?
Hi there,
Happy to help out here.
I am seeing that it isn't possible using the getDisplayedData() option, but you can set a variable to the table data and then return the variable. The format of the data will be different from getDisplayedData(), but you can transform it to match that prior to returning it:
Let me know if this helps and if you have any additional questions!
Best,
Evan
We'll reach out when this bug is fixed
Hi @Tess , I just encountered this issue. As this forum post is still open — no Solution marked, nor follow-up confirmation about the fix — is it okay to continue tracking in here?
My setup is simple: A module has a tabbed container, with a table within tab 1.
When i call getDisplayedData()
on the table while tab 1 is active, I get the results. Perfect.
When I call getDisplayedData()
after clicking making tab 2 active, I get undefined
.
If I go back to tab 1 and try again, it works as expected.
(I performed this in the Debug console, but I get the same results when trying to access the displayed data method in a component's dynamic field.)
Maybe it being a module is a factor? I don't have extra time at the moment to recreate the setup in a vanilla app, but that would be a good next step I think.
Retool version 3.107.0
(My use case is that I have some custom columns in the table, and would like a chart component on tab 2 to be able to reference them in the displayed data.
Admittedly I could just first transform the data under the hood then feed that to both the table and the chart, but it's so convenient just creating the custom column and any other value mappings right in the table that it'd be great to have access to those anywhere in the app/module!)
Hi @dguzzo Thanks for chiming in (always welcome on open topics!)
Unfortunately, this is still an open bug - table apis, like getDisplayedData, only work when the table is currently visible on the page (i.e. not hidden or on another tab). The module aspect shouldn't make a difference in this case. You'd need to store the table information in a query/variable/etc while the table is still on the page.
This is a common request & I can see a lot of use cases for it! I've added your +1 to the internal request where we are tracking feedback. I'll follow up here if there is any movement on the request
All of that sounds great, thanks for the info, Tess!