How to Get Data from Current Row and Specific Column in a Table?

Hi,

I have a table, and I want to retrieve data from the current row. However, when I try, it shows me the entire dataset instead of just the data from the current row.

Could you please help me understand how to get the data from the current row and from a specific column?

Thank you in advance for your help!

Tables have a selection.data property that should contain the data in the selected row(s). Select the column via name from there. ({this.props.selection.data[0]}['columnName'] or similar)

Your current binding will change EVERY row's background color, is that what you actually want? If you want to change the background of the selected row, adjust the selection.style property.

Also, it's better to use an expression when possible instead of a script transform, unless you need to loop through something.

Accessing a dataset via expression

1 Like

Hi Ryan,
Thanks for sharing helpful info but i want to change all rows depend on one column “STATUS” value.
Thanks if you help in this way.

Your problem is still underspecified.

Do you want:

  1. When the value of a particular column in any row is something specific, make the whole row a certain style
  2. When the value of a particular column in any row is something specific, make the entire table a certain style
  3. When the value of a particular column in a particular row is something specific, make the entire table a certain style

Or something else entirely?

  1. When the value of a particular column in any row is something specific, make the whole row a certain style

In that case, you'll need to loop through your data BEFORE providing it to the table, and insert style configurations into the row data for the rows that match your criteria.

Create a custom property on the view, and bind your data source to that custom property. From there, bind your table data to that custom property and apply a script transform. The manual has a fast example:

1 Like