I have a table that pulls it's data from a javascript query . My table then has a column for all the returned values in the query. However there is one additional column where it's doing some mapping based on the URL column and is then mapping that data to display what is needed to see in the table.
I now want to display those name values in a text field, however since category_values isn't part of the table data, I can't just do something like {{table.selectedRow.category_values}}. I can see the values in the table UI, how can I access that?
I have tested that but when I make a JS query that is return myTable.getDisplayedData() it appears to be returning the same data as the myTable's source data. It isn't displaying what is shown in the table. I don't see the category column in the getDisplayedData().
Is there another step needed to make getDisplayedData() work in a JS query?
My only other thought at this point is to change the data structure so the data transformation happens before it is displayed to the table, but that would take a bit of reworking the app.
+1, Facing exact same Issue. I want to get exact Column Name as displayed in the table along with relevant data. table1.data and table1.getDisplayedData() are not the solution for the above. They don't return in the manner required.
Just tested again and still not working for me. As my first screenshot of the table shows, there's a column named Category that has some words formatted as tags.
Here is my query just to test getting the results of that displayed data
Hey @SGMH can you share a bit more about how this table is set up. Is Category a column that is returned in the JS query which populates the table? Or is this a custom column added afterwards?
Just tested table.getDisplayedData() and it seems to work in both cases with dynamically mapped values. If you could share a bit more about your specific setup, I can try and reproduce the issues you are having. Thanks!
Hey @SGMH mind trying this sample app out to see if it works for you? Displayed data returns the correct info here on a custom column and an existing column with data that is different than the source.
If possible would love to get an app export and a couple sample rows of data from your table and category_values so that I can repro.
Thanks @joeBumbaca. Your example app was helpful and pointed me to what the issue is! I basically modified your example app as best I could to replicate my actual app to see where the issues lie. The culprit? column id
I noticed the error icon on the columns in my table and it was because the original column and updated categories column were both pulling from the same source. And since both columns had the same ID (which was blank, so it was using the source value of id), table2.getDisplayedData() didn't return all the data as it had duplicated IDs. Once I gave both columns a unique ID, the data now displayed! So yes, the function is working correctly, it was merely a user error that Retool alerted me to and it didn't click to be the source of the problem until now. :
Thank you all for the help in figuring this out and hope it helps others who might be having a similar experience.