Help with Setting Up Conditional Formatting in Grist

Hi everyone… :wave:

I am new to Grist and loving its flexibility so far! Although, I am struggling to set up conditional formatting for one of my tables. I want a specific column to change its background color based on the values (e.g., green for “Completed,” yellow for “In Progress,” and red for “Pending”).

I also check this: https://community.getgrist.com/t/small-help-with-upvote-on-improving-grist-module-on-maksalesforcedeveloper But I have not found any solution. Could anyone guide me about this? I have checked the documentation and tried a few formulas, but I can’t seem to get it right. Could someone guide me through the steps or share an example formula for this?

Thanks in advance for your help! :blush:

Respected community member! :smiling_face_with_three_hearts:

Hi there,

In the ‘Column’ tab of the Creator Panel (right-hand side of the page), click ‘Add Conditional Style’.

Because you want to match a specific string in the column, we use double quotes to specify this in our conditional formula. In this example, I want to change the formatting based on the value in the Status column. You said you want to make the fill color green when Status is “Completed” so the formula is $Status == "Completed". Then, click the ‘Cell Style’ box and select your fill color.

Thanks,
Natalie

Hello,
Will you suggest a formula for matching a partial string in a column? For example, in $Location, I want to highlight all entries that contain partial string “Indian River”
Thanks!

Hey @Doug_Bomeisler !

You would use the in operator to check if a specific string appears within a cell. Using your example, the conditional formula would be;

"Indian River" in $Location

Thanks,
Natalie

Thank you, Natalie. That is the exact formula that I tried but it did not work. What I failed to mention previously was that $LOCATION is a reference column (a two-way reference column), and this appears to be where the failure lies. Reference columns don’t appear to support conditional style formulas.

Hey @Doug_Bomeisler !

Ah yes - with a reference column, it’s storing a record’s unique ID, not the value you’re actually seeing. You select a value under ‘Show Column’ to use as a label to represent the record. We want to check for a string match in the Location column in the referenced table so our conditional formula needs to be modified to "Indian River" in $Location.Location

This uses dot notation to look at the referenced record in the Location column. Specifically, we want to the know the value from the Location column in the referenced table.

Thanks,
Natalie

Thank you Natalie! Very well explained, that saved me a lot of time and frustration.

1 Like