Forum Discussion

AshleyGwozdz's avatar
AshleyGwozdz
Qrew Member
3 years ago

color coding - multiple types of fields

Can anyone help with the following color-coding formula? I couldn't find an example in the help guide of different types of fields in one formula.

The first field is multiple choice and I only want to color code one of the three choices, otherwise, no color.
The next three fields are checkboxes and I want to color code if true, otherwise, no color.

I am getting an error only on the closing parentheses that says "expecting text but found bool".   

We would prefer to color code the entire record row for easy identification, which is why I am trying to do this from the Default report settings, but if there is another way, I would be glad to know it.

Thanks!

Case(

[Multiple Choice Field], "Option2", "#f0f0f0",

[Checkbox Field 1], "true", "#dbfffd",

[Checkbox Field 2], "true", "#ffebbf",

[Checkbox Field 3], "true", "#ffffbf",

)​


------------------------------
Ashley Gwozdz
------------------------------

4 Replies

  • What happens if all checkboxes are true? What color should it be? Or if it says Option 2 and Checkbox 1 is true? What color should it be?

    ------------------------------
    Mike Tamoush
    ------------------------------
    • AshleyGwozdz's avatar
      AshleyGwozdz
      Qrew Member
      I read somewhere that the topmost color should take precedence, and they are listed in order of importance.  This is how it was working for me before (when all four fields were checkboxes). 

      I was using this code before:

      Case(true,

      [Checkbox Field 1],"#f0f0f0",

      [Checkbox Field 2],"#dbfffd",

      [Checkbox Field 3],"#ffebbf",

      [Checkbox Field 4], "#ffffbf"
      )


      ------------------------------
      Ashley Gwozdz
      ------------------------------
      • MikeTamoush's avatar
        MikeTamoush
        Qrew Commander
        Ok yes order will be from top to bottom. In this case, since you are looking at multiple fields, you need an if statement.

        If(

        [Multiple Choice Field] = "Option2", "#f0f0f0",

        [Checkbox Field 1] = true, "#dbfffd",

        [Checkbox Field 2] = true, "#ffebbf",

        [Checkbox Field 3] = true, "#ffffbf"

        )​

        As soon as it hits a true statement, that is the color that will be used.
        ------------------------------
        Mike Tamoush
        ------------------------------