1

In my list, I have several columns formatted in either green, yellow, or red based on their individual content.

What I want is to format the first column to reflect the overall status of the row/entry. For example, if there are any red columns in the row, the first column will be red. If there are no red columns but are yellow columns, the first column would be yellow. Else, the first column would be green.

Ideally, I would be able to do this in one fell swoop by iterating through all columns at once, but I can't find a variable to reflect all columns. I have also tried calling out to the colored columns individually, but I can't manage to reference their background color.

1 Answer 1

0

You can render a column's format within a view format using columnFormatterReference, but even then you don't have access to the generated property values (such as background-color). In formatting, (column, view, or form) you have access only to field values from other columns in your view. You don't even have access to expression results for properties within the same format.

This means that you cannot short circuit the display logic. In practical terms, this means you'll need to repeat the logic from the other columns that determines their background-color in order to make decisions on those results.

1
  • That's a bummer but also what I suspected was the case. Thanks for the clarification!
    – Foxhole
    Commented Mar 31, 2022 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.