This page is for data modellers or application developers who want to apply special formatting to data that meets specific criteria.
A formatting rule allows you to specify an expression which evaluated can apply the selected style to the parent object. It allows to apply styles conditionally, depending on current values displayed on the screen; see Applying Formatting Rules for some examples.
A formatting rule can be applied to a view attribute or to a component. If you apply a formatting rule to a template component, all components created from the template will have a copy of the formatting rule applied.
For information about the toolbar options, see the Common Properties page, Toolbars and Controls section.
If this item is within or belongs to another, it's parent name is shown here. See the Common Properties page, Parent Details section for more details.
Field | Description |
---|
Rule Expression | Expression to be evaluated on order to determine should the Style be applied. This expression takes PhixFlow Internal Variables. See examples below. For more help on expressions, see Regular Expressions and Expressions and PhixScripts. |
Style | Style to be applied when the Rule Expression evaluates to true. |
Order | Order of the Rule Expression. |
Enabled | Flag showing is the Rule Expression enabled. |
Stop If True | Flag showing if other rules shouldn't be applied if the current Rule applies. |
See the Common Properties page, Audit Summary section.
For the Status Type
attribute in a view, set the properties to:
For the Status Type
attribute in a view, set the properties to:
- Rule Expression:
- either
_field.value == "OK"
- or
_current.StatusSummary=="Validation Passed"
- Style:
BackgroundColour-LightGreen
- Enabled: Tick
_field.value == "OK"
identifies the status type of OK and highlights the cell
_current.StatusSummary=="Validation Passed"
identifies the status summary of Validation Passed and then highlights the corresponding status type cell.
This displays the OK
field with a green background.
In formatting rules, you can use the following Internal Variables.
- To determine the maximised state of a screen, use _screen. In a formatting rule, use the state of this variable to set the button icon. This means the button can match the current maximised state of the screen.
- To act on a specific record use one of the following:
Formatting expression variable | Where |
---|
View directly on a screen | Form on a screen | View on a form | Form on a card | Grid on a card |
---|
_form acts on the record | na |
currently displayed on the form | currently displayed on the form | currently displayed on the card
| backing the card |
_grid acts on the record | na | na | na |
_current acts on the record | currently displayed in the grid
| na | currently displayed in the grid | currently displayed in the card | currently displayed in the grid |
_selected acts on the selected item | na | Currently selected field | na | Currently selected card Currently selected field | na |
_value acts on composite components | na | Access the value in the field | na | Access the value in the field | na |
For quick changes to screen appearance, you want formatting rules to be evaluated quickly. To ensure a quick response, only use the attribute functions that are evaluated by the client rather than the server; see the list of Responsive Attribute Functions.