Skip to main content

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

  1. In the Item Form Builder, select Expressions in the toolbar to show the form's expressions on the left. Select to create a new expression.

    The Expressions box
  2. In the Item Form Expression Builder, select Edit at the top. Enter a name that clearly describes the expression and then select Save.

    The edited name of the new expression

Add a global Boolean node

  1. Select Global in the toolbar and choose Boolean to add a node to the canvas.

    The list of global node types
  2. Select on the node, select Global value and then choose Dangerous? Value.

    The global node appears on the canvas
    A list of available values for the global node

Add a final Boolean node

  1. Select Final in the toolbar and choose Boolean to add a node to the canvas.

    The final node appears on the canvas
  1. Select the right circle of the global Boolean node and the left circle of the final Boolean node to link them together.

    Two nodes linked together

Save and target

  1. Select Save (bottom-left) to finish.

  2. Back in the Item Form Builder, select the Description control, select beside its Required property and choose your new expression.

    The Required property of the Description control showing as targeted to the expression
    Note

    Don't forget to save the item form too!