Example: Showing Fields in Different Colors Based on Value

This topic describes how to colorize an incident record based on the value in the Impact field.

1.Create the styles to use on your form. See Using Highlighter Styles.

In this example, we created a list style that shows a yellow background. You could create a style for each impact value (low, medium, high).

Example New List Color

2.Apply the style to a field in your form. See Creating a Form for information on how to use fields.

In this example, we opened the Incident.ServiceDesk form, and applied the style to the Impact field using an expression in the Style Rule parameter.

Edit Expression to Include Color Style

$(if( Impact == "Low"), "LowImpactColor",
if( Impact == "Medium"), "MedImpactColor",
if( "IncidentSLAThirdEscalation"), "ImpactColor"))) 

3.Click Save to close the window.

4.Open the Incident workspace from the Service Desk Console and observe the background color of the Impact field.

Colors Based on the Impact Value

Note that in the Style Rule property you can use the same values as in the Style property. You should specify the underlying values (not the display values) when using them in expressions.

Default Styles can be Used in Style Rules

The reverse is not true; it is not possible to use styles for the Style property, or in control style expressions.