Any way to bring properties into table extension functions?

I have a very small table, 4 rows, with 3 columns, step number, instruction for that step, and a status column. What I ideally want is that for the current step in the process to be a certain color, yellow, any previously completed steps to be green, any future step to be default. I tried looking into the extension function thinking I could just do if this current row is selected, make it yellow, if the row number is < selectedRow, make it green and I’d be done, but I see there is no tag/property button on the top right of the script editor as there usually is. How can I go about making this work?

So I am completely clear, on open -
Row 1 - yellow
Row 2 - default
Row 3 - default
Row 4 - default

User completes step 1

Row 1 - Green
Row 2 - Yellow
Row 3 - Default
Row 4 - Default

User completes step 2

Row 1 - Green
Row 2 - Green
Row 3 - Yellow
Row 4 - Default

and so on. How can I accomplish this? I have a root container variable that keeps track of what step in the process I am currently on and will only increment when the current step is complete.

Edit - per this post Change row color of table dynamically

I found a decent way to make a single column the correct color, how do I apply a single columns background color via mapping apply to the entire row? Then I will be set.

Is this using the regular table or the power table? The powertable has a configureCell extension function that is called for every single cell and you can do some logic (keep it very simple or it will slow down).

The extension functions (and custom functions you make on an object) all have the self object. Use something like self.data to set the data property, for instance. Or self.stepNumber if your custom property is called stepNumber.

It’s a regular table.

I have got this much done - I got one column, a dummy column that I will eventually hide but has an integer for mapping purposes, to change at each step of the process.

If i can just apply it’s background to the entire row, I would be set. Any idea on how to do that?

If I understand what you are looking for, I think you may be looking for the ‘Background Color Mapping’ portion of the table customizer.

Set the Background Mode property on the table to ‘Mapped’, then open the Table Customizer and switch to the Background Color Mapping tab. You can select the column that contains the variable to use for color mapping (must be a numeric column), and then set the color associated with each number.

1 Like

That was it, thank you!