Prerequisites
Procedure
- When adding or editing a form or detail block, on the Settings page, scroll down and at the bottom under the Form interactions section, on the right, select ADD INTERACTION.
- In the Title box, enter a meaningful title for your interaction.
- From the Applies to list, select when you want the action to apply to the form:
- Create - When the form is not opened from an existing record, and no ID is passed into the form. For example, when adding a new person to a directory.
- Update - When the form is opened from an existing record, and an ID is passed into the form. For example, when you open the form from another page to update the details of a record such as editing a person's details on a directory.
Conditions
Form interactions are typically used to add an action to a form field when certain conditions are met. If you don't have any conditions to be met, you could edit the field itself, see our knowledge base article, Add a Form block.
- Under the Conditions section, choose under what conditions you want the action to take effect:
- Meet ALL of the following conditions (and) - When the criteria meet every condition in this section.
- Meet AT LEAST ONE of the following conditions (or) - When the criteria meet at least one condition in this section.
- Under the relevant section, select ADD CONDITION.
- From the Field list, select the form field to which you want to apply the condition.
- From the Criteria list, select your criterion. The available criteria depend on the form field that you selected. For example, if you select a date field the criteria differ than if you select a text field.
- If you selected a criterion that requires a value, in the Value box, enter the value you want the criterion to meet.
Actions
These actions override the settings for the field when the conditions are met, see our knowledge base article, Edit field.
- Under the Actions section, select ADD ACTION and configure the action you want to take when the conditions are met. Select the action you want to add to see how to set it:
- Add or change the field's help text
- Change the field label
- Make a field mandatory
- Make a field read-only
- Enter the default value for a field
- Hide a field
- Remove a field's help text
- Remove a field's label
- Clear a field's value
- Add fields from the linked Model
- Add a field to show the count of the rows added
- Add a field to show the total sum of the field values from added rows
- Add a field to show the average of the field values from added rows
- Add a field to show the minimum value of the field values from added rows
- Add a field to show the maximum value of the field values from added rows
- Once you've finished adding your actions, select UPDATE.
You can combine two actions to achieve the outcome you want. For example, you could make a field, "Vacation allowance" read-only and set the value for the field to the allowance amount for the type of user. You'd set the conditions so that this only shows to users with this allowance.
Add or change the field's help text
- From the Type of actions list, select Set Attribute.
- From the Target Field list, select the field from your form to which to add the action.
- From the Target Attribute list, select "Help text" and in the Value text editor, enter the text you want to appear under the field.
Change the field label
- From the Type of actions list, select Set Attribute.
- From the Target Field list, select the field from your form to which to add the action.
- From the Target Attribute list, select "Label" and in the Value box, enter the text you want to appear as the field's label.
Make a field mandatory
- From the Type of actions list, select Set Attribute.
- From the Target Field list, select the field from your form to which to add the action.
- From the Target Attribute list, select "Required" and then the Value option. If the Value option is left clear, the field is not mandatory when the conditions are met. This applies even if the property was configured to be "Required" on the model's schema. See our knowledge base article, Edit a property.
Make a field read-only
- From the Type of actions list, select Set Attribute.
- From the Target Field list, select the field from your form to which to add the action.
- From the Target Attribute list, select "Enable" and then select the Value option. If the Value option is left clear, the field is editable.
Enter the default value for a field
- From the Type of actions list, select Set Attribute.
- From the Target Field list, select the field from your form to which to add the action.
If you have a linked model with similar named properties, make sure you select the right property.
- From the Target Attribute list, select "Value" and in the Value box, enter the information you want to appear in the form. If the field is enabled, the user can still edit this value. If the Value option is left clear, the field is visible.
Show or hide a field
- From the Type of actions list, select Set Attribute.
- From the Target Field list, select the field from your form to which to add the action.
- From the Target Attribute list, select "Visible."
- To show a hidden field when the conditions are met, select the Value option.
- To hide a field when the conditions are met, make sure the Value option is clear.
Remove a field's help text
- From the Type of actions list, select Clear Attribute.
- From the Target Field list, select the field in your form that you want to hide the help text for.
- From the Target Attribute list, select "Help text."
Remove a field's label
- From the Type of actions list, select Clear Attribute.
- From the Target Field list, select a field from your form to which to add the action.
- From the Target Attribute list, select "Label."
Clear a field's value
- From the Type of actions list, select Clear Attribute.
- From the Target Field list, select a field from your form to which to add the action.
- From the Target Attribute list, select "Value."
Copy a field value from the primary model poperty to the linked Model property
You need to add a condition with the criteria "is known" for the primary model property field. For example:
- Field: "Time off dates (start date)"
- Criteria: "is known"
- Value: Selected
- From the Type of actions list, select Set Rows.
- From the Target Field list, select the linked model field you want to copy the value to. For example, "Daily breakdown - Daily date."
- From the Target Attribute list, select the primary model's property whose value you want to copy to the linked model. For example, "Time off dates." See our knowledge base article, About form interactions.
Count the rows of a linked model and display the value in a number property for the primary model
You need a number property in the primary model to select from the Target Field option.
- From the Type of actions list, select Count Rows.
- From the Target Field list, select the number field where you want to store the count value.
- From the Target Attribute list, select the linked model whose rows you want to count. For example, "Daily breakdown."
Adds all the values of the linked model property
- From the Type of actions list, select Sum Column.
- From the Target Field list, select the number field where you want to store the total value.
- From the Target Attribute list, select the linked model's property whose value you want to add up.
Add a field to show the average of the field values from added rows
- From the Type of actions list, select Average of Column.
- From the Target Field list, select the number field where you want to store the average value.
- From the Target Attribute list, select the linked model's property whose value you want to find the average.
Add a field to show the minimum value of the field values from added rows
- From the Type of actions list, select Min of Column.
- From the Target Field list, select the number field where you want to store the minimum value.
- From the Target Attribute list, select the linked model's property whose value you want to find the lowest value.
Add a field to show the maximum value of the field values from added rows
- From the Type of actions list, select Max of Column.
- From the Target Field list, select the number field where you want to store the maximum value.
- From the Target Attribute list, select the linked model's property whose value you want to find the highest value.