logo

Changing the style of context variables display

This article provides an example of a Razor form, which allows changing the display styles for context variables of simple types: string, number, date, etc. This form can be used to draw the user's attention to the variable value.

The script uses:

  • Message – context variable of the String type;
  • color:#CD5555 – variable display color code;
  • font-weight: bolder – bold font. 

To add razor to the form, go to the form builder.

To create a process task form in the form builder:

  • Open the task settings, select the Form (context) tab.
  • Select Form Builder form type and click Create New Form.

 

In the form builder, add a Panel element to any spot on the form.

In the panel settings, go to the System tab and click Edit.

In the opened window, you can change the view name (optionally), and click OK.

In the opened window, click Edit.

Next, replace the entire code with this code.

<style>
#Entity_Message_ValueContainer {
color:#CD5555;
font-weight: bolder;
}
</style>

As the result the context variable will be highlighted as in the figure below:

 

Note
If you need to apply one style to several context variable, you can specify them separated by commas.
If you need to change the color of the variable name as well as the value, specify #Entity_Message_CaptionContainer