Example 1 - Simple boolean check
This example demonstrates a simple scenario:
I want to enable/disable a control property based on the status of another.
Let's imagine an example of this:
My item form has controls for a Yes/No attribute named "Dangerous?" and a Text attribute named "Description".
If a user enables Dangerous? I want Description to be required. So I'll create an expression to make the Value property of the Dangerous? control available to the form. I can then set the Required property of the Description control to target the expression.
Create and name the expression
- While editing an item form, select in the Expressions box to create a new expression.
- In the Item Form Expression Builder, select at the top to name the expression with a clear description of what it does.
Add a global Boolean node
- Select Global in the top toolbar and choose Boolean to add a node to the canvas.
- Select on the node, select Global value and then choose Dangerous? Value.
Add a final Boolean node
- Select Final in the top toolbar and choose Boolean to add a node to the canvas.
Link them together!
- Select the right circle of the global Boolean node and the left circle of the final Boolean node to link them together.
Save and target
-
Select Save (bottom-left) to finish.
-
Back in the Item Form Builder, select the Description control, select beside its Required property and choose your new expression.
Note
Don't forget to save your item form!