Use field value matching

Setting the color of a label to change based on the value of a severity field

The severity is specified in an edit field whose input is $severity. You set the Color Condition of the label as follows:

[$severity]? "sev1","sev2","sev3" : 1,7,2

This statement tells the label to do the following:

  • Use a color value of 1 (red) when $severity="sev1"
  • Use a color value of 7 (yellow) when $severity="sev2"
  • Use a color value of 2 (green) when $severity="sev3"

Specify a value to use if no match is found

[$severity]? "sev1","sev2","sev3" : 1,7,2, 0

This tells the system to use color 0 (black) if $severity is none of the listed "sev" values.

Note: The $severity field must have been assigned as input to at least one field on the screen.

Related concepts

Dynamic View Dependencies
Field comparisons
Field value matching
Dynamic functions

Related tasks

Use form dep.g to demonstrate Dynamic View Dependencies
Use field comparisons
Use dynamic functions