Perspective Table Dynamic Row Highlight Based on Dataset Tag Value Match

Hi All,

I am working on an Ignition Perspective Table component.

My table data is coming from a Dataset Tag:
[default]IGBT_ROBOT_CELL_PROD/SAP_RES_Dataset

The table contains a column:
"Prod. Order No"

I also have another tag:
[default]IGBT_ROBOT_CELL_PROD/OrderNumber

Requirement:
Whenever the value of OrderNumber tag matches any row's "Prod. Order No", I want the entire row to be highlighted dynamically.

I tried:

  • Script Transform on props.data

  • props.rows.style.classes expression binding

  • Row style bindings

But since the table data originates from a Dataset Tag and Perspective internally converts rows into objects containing value/style properties, I am facing issues with row styling and expression syntax.

What is the recommended Perspective approach to dynamically highlight a row based on matching tag value with a dataset column value?

Thanks.

The canonical approach would be an expression structure binding on your table's props.data referencing the raw dataset and the order number tag. That would have a script transform to generate the row objects, styled or not per the comparison.

I don't like script transforms (mainly for performance), so I would use my Integration Toolkit to perform the above in a single expression binding. Something like this:

transform(
    {[default]IGBT_ROBOT_CELL_PROD/OrderNumber},
    forEach(
        {[default]IGBT_ROBOT_CELL_PROD/SAP_RES_Dataset},
        if(
            it()['Prod. Order No'] = value(),
            asMap(
                forEach(
                    it(), // key/value pairs of the row
                    it()[0], // column key
                    asMap(
                        'value', asMap(it()[1]), // column value nested
                        'style', asMap('backgroundColor', '#ff3333')
                    )
                )
            ),
            asMap(it()) // optimized unstyled conversion of a whole row
        )
    )
)