Is dynamicColumnSettings available in the new tables component?

Does the new table component support dynamicColumnSettings?

My main use case is when building our dashboards. I have many tables and each display lots of columns. I programmatically set the column type and formatting is to help reuse formatting conventions. This avoids having to click through the UI to one-by-one to change the formatting.

Hi @huang3r! Yes, dynamic columns are supported as of version 3.7.0. You can find them in the advanced settings menu in the Table Content editor (or search using the command palette).

Thanks @andoliveyou! I see it there - can you give me an example of how to use it for my scenario? Looks like what previously was a single field is now expanded into three fields? Markup 2023-08-08 at 09.29.03.png - Droplr

Here's an example of my existing value for a table where I am using dynamicColumnSetting:

[
  {
    "name": "PERIOD",
    "mapper": "{{(self === null ? '' : (moment(self).isValid() ? moment(self).format(\"MMM DD[, ]YYYY (ddd)\") : self)) }}",
    "type": "text",
    "colorMapper": "rgba(255,255,255,0.2)"
  },
  {
    "name": "REVENUE",
    "mapper": "{{(self === null ? '' : ( numbro(self).format({ output: \"currency\", thousandSeparated: true, average: false, mantissa: 0,  }) ) ) }}",
    "type": "text",
    "colorMapper": "rgba(255,255,255,0.2)"
  },
...
]

Sure! When you enable dynamic columns, the table automatically maps over and creates columns for the keys in your data source. In the three inputs (label, format, hidden), you can reference columns using the {{ item }} property to set basic configurations for each column.

For your use case, it sounds like you might want to:

  • List item
  • map over the keys to create titles with a function like startCase({{ item }})
  • consider using the auto format option with predicts the format of your column

As for the formats rules, you can add rules per format using the Column properties editor.

1 Like

I'm not sure I follow, could you give me an example of how to translate what I had in my example into the new dynamic column input format?

Hope this can help.

Note that if you've already manually generated columns from the data, you currently need to first clear them off before the dynamic columns can do its thing.

2 Likes

What you guys are showing makes sense - I can programmatically set the label and format for a specific column.

However, my scenario is that I'd like to programmatically set the label and format for all my columns. So I would retrieve a list of columns along with the formatting instructions from the server and provide that variable into the table.

Is that possible? In the solution you guys are showing, would I have to click into the UI for each column name?

Appreciate the help.

Hi @huang3r,

For setting all of the labels, I believe you'd have to clear them all from the column list, as @rixlayer mentions

It looks like we're still working on adding dynamic column settings for mapped values & colors :disappointed:

Hello @Tess, do you have an ETA on adding dynamic column settings for mapped values & colors?

I've migrated to the new table but colours are a key element to the data presentation.

PS: I've migrated because I wasn't able to export the old table keeping the colors in the excel export.

Hi @Nicola_Genesin! No eta yet :disappointed: But I'll post here if I get an update

2 Likes

+1 for dynamic column values / formats in the new table component -- we're using table components for some data presentation that we can't accomplish currently in the new component.

3 Likes

I am also finding the new table component to not be dynamic enough for my use cases. I still use the legacy table.