How do I access data displayed in a table?

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.

{{  category_values.value.filter(x => (item.match(/cats=([^&]*)/)[1].split(",")).includes(x.id.toString())).map(x => x.name)  }}

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?

Screenshot 2024-04-04 at 4.25.26 PM

Hey there @SGMH

Link to similar topic here Filtered Table Values - #2 by mckenna & here How to get the sum of a column in a table component - #14 by Kabirdas

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.

1 Like

Hi there,

Thanks for reaching out to us! I just tried to test this on my end and it seems to work as intended.


Is there something different about my setup here in terms of data query? Please let me know!

Referencing the data in another query worked here as well.

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

You can see in the data output that it doesn't include the Category column.

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!

Category is a custom column added after the JS Query populates the table. And the values for the Category column are: