Discussions

 View Only
  • 1.  color coding - multiple types of fields

    Posted 01-03-2022 14:27
    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
    ------------------------------


  • 2.  RE: color coding - multiple types of fields

    Posted 01-03-2022 14:47
    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
    ------------------------------



  • 3.  RE: color coding - multiple types of fields

    Posted 01-03-2022 14:58
    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
    ------------------------------



  • 4.  RE: color coding - multiple types of fields

    Posted 01-03-2022 15:08
    Edited by Mike Tamoush 01-03-2022 15:11
    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
    ------------------------------



  • 5.  RE: color coding - multiple types of fields

    Posted 01-03-2022 16:34
    Thanks!  Works perfectly!

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