How do I add conditions to a form?
In this example, we'll add a condition that specifies that a form displays only if a certain Case priority level is reached. First duplicate the layout, or choose your layout, then do the following:
-
Click the Click to add condition link.
- From the
Attribute drop-down list, select the priority code
value:
$fields.PriorityCd.value()
, then in the Value field, enter: ORA_SVC_HIGH as shown in the following example:
Now the layout will only display when a case has a priority value of High.
Example of Making a Layout Visible Based on Category Conditions
Here's an example of how to make your layout visible when using category conditions:
-
In the categoryId field add the value within single quotes as follows:
$fields.CategoryId.Value() === '123'
-
For the categoryName field to display, you must expose it in one of the create layouts.
Create a dummy layout and expose categoryName and use the category Name value in the conditional rendering.
For example:
$fields.CategoryName.Value() === CategoryName Document URL and section