Forum Discussion
How to access cell values from table data view?
- 5 years ago
Hi Anonymous,
The details of the table data view mapping are supplied in the docs, including some output based on a sample dataset, but to break this down further:
You can access rows as table.rows[x] where x is a 0-based index, exactly like a JavaScript array.
Each row is an array of column values, so table.rows[x][y], where y is the index of the column you want the value for.
If you need to know which index represents which column, the column metadata is in the table.columns array. The index of each item corresponds with the index in the resulting rows array.
So, for example if your table.columns[0] entry represents 'Jahr' then table.rows[x].[0] will be the value of 'Jahr' for the given row entry.
Regards,
Daniel
Hi Anonymous,
The details of the table data view mapping are supplied in the docs, including some output based on a sample dataset, but to break this down further:
You can access rows as table.rows[x] where x is a 0-based index, exactly like a JavaScript array.
Each row is an array of column values, so table.rows[x][y], where y is the index of the column you want the value for.
If you need to know which index represents which column, the column metadata is in the table.columns array. The index of each item corresponds with the index in the resulting rows array.
So, for example if your table.columns[0] entry represents 'Jahr' then table.rows[x].[0] will be the value of 'Jahr' for the given row entry.
Regards,
Daniel
That helped. Thank you, dm-p!