Access custom columns in JS query

How can I access custom column key and values in JS query?

Use case: I added a custom column namedfoo with value foo? Is there a way to reference this custom column name and value in JS query?

Hi @alisher :wave: typically custom columns are accessed using "Custom Column" and then the custom column number, so, for instance: table["Custom Column 1"] does that work?

Hi @Kabirdas: table returns undefined if though I do I have a custom column added.

Let's say I have some data in the table. Looks like I can access this data with table.displayedData but it does not give me the custom columns and values.

Is there a workaround ?

Ahh my mistake I was thinking of the records in table.recordUpdates can you describe your use case a little further? How are you looking to use your custom columns?

Let's say we have some data coming from our api. Say customer data which has id, payAmount. itemWeight. We add a custom column Value to Weight ratio. Then, we would like to add download all data button. Currently, the custom download functionality on the table only allows users to download the first paginated result set, not all data set.
.
So I was thinking I would write a script that loops through all results of the data including custom column. Is that possible?

I see, after doing some digging it looks like you'll have to recalculate those values in your script when creating the downloadable data :confused:

@Kabirdas thanks for your support. For table component, it will be great to add a property let's say table.tempData which references all column keys and values in the displayed table including custom columns as currently displayed on the frontend. Something to consider for the future :slightly_smiling_face:

This is actually something we're planning on taking a look at! There's no timeframe or guarantee for it making it in but I'll pass your feedback along. If you're interested you might also want to make a post this as a feature request so that it can get more visibility there.