If you wish to use the fields within a Subform of your form while configuring the Field Rules, you will have to to
switch to Advanced Rules.
Let us look into a few scenarios to understand how
Field Rules can be used with
subform fields.
You have a Subform within your Job Application form with a section to provide education qualifications. It includes fields for selecting a qualification and entering a University name. You want to ensure that if a user selects a qualification, they provide the corresponding University name.
Field Rule:
Condition: If Qualification (subform field) is not empty
Action: Show School/University Name (subform field)
This rule checks if the Qualification field within the Subform is filled. If a qualification is selected, only then it shows up the School/University Name and the Year Completed fields in that Subform row. If the University Name is left blank while a Qualification is selected, an error message will be thrown to prompt the user to provide the missing information.
When using Subform fields in both the condition and action of a Field Rule, the rule will be evaluated for each row added in the subform, and the action will be performed accordingly. This allows you to apply the condition and action to each individual row within the subform.
You have a form to order a gift where you let the users choose if they want to include flowers and chocolates. You have a Subform within this form to get additional details about the flowers and chocolates. If the user selects to include only flowers, then hide the column that asks for details about chocolates. This ensures that when the user chooses only flowers, they won't see or be prompted for information about chocolates. This ensures that when the user chooses only flowers, they won't see or be prompted for information about chocolates.
Field Rule:
Condition: If Include Flowers (form field) is selected
Action: Hide
Select Chocolates (subform field)
When using a form field in the condition and a Subform field in the action, the Field Rule evaluates the condition based on the the form field, and then the action is performed on all rows of the subform.
Note: When using 2 rules to execute action on a subform field, the rule with the form field in the condition takes priority and is evaluated first.
Points to remember
- A Condition field must be placed prior to the Action field.
- If a Formula field is used in the rules, field(s) involved in a formula must be placed prior to the Formula field in the form.
- Once you choose a particular action (Show/Hide) for a field, you will have to continue using the same action on that field in any rule elsewhere. For example, if you choose to Hide the Phone field, you must use the Hide action to use the Phone field elsewhere in the Then section.
- Rules are case-sensitive which means the conditions trigger actions only when the case of the text in the defined condition matches the case of the respondent input. Check out an example to understand this better.
- A rule condition cannot include fields from multiple Subforms of the same form.
- If you use a Subform field in a condition, only the fields of the same subform can be used in the action of that rule.
- If all of the fields used in a condition's rule are form fields and do not involve any subform fields, you can use any subform's fields in the rule's action.
- The Subform field used in the condition must be placed prior to the subform field used in the action of that rule.