Access column labels in a table

Hi, how do I programatically access the column labels?

This code gives me the column keys only. I want to be able to access column labels.

Hi @engineering-tajir,

I created a transformer to expose the table’s column names, and it worked perfectly.
Here’s the code I used:

return {{
  Object.keys(dailyDataTbl._columnKey).reduce((out, colId) => {
    const key = dailyDataTbl._columnKey[colId];
    const label = dailyDataTbl._columnLabel[colId];
    out[key] = label;
    return out;
  }, {})
}};

This returns an object where each column key is mapped to its label.

1 Like