A conditional form is a regular Caspio form with rules consisting of criteria and conditional actions. You can apply conditional rules to create dynamic change forms that fine tune fields based on user entries. In the Rules tab of the DataPage wizard, you can create various conditions to hide, show, require or disable specific fields based on the value or selection of other fields in the same form.

The following conditions can be applied to Caspio forms (submission, search, single record update, or details page):

  • Hide/show fields or a section of fields
  • Make fields required
  • Disable a field
  • Make fields Display Only (non-editable)

conditional_forms_1

Adding a New Rule

In this article, you create new criteria on a submission form. Ensure that a submission form has been created already.

  1. Navigate to the DataPages listing and click Edit to configure the Submission form. Go directly to the Configure Fields screen in the DataPage Wizard and click the Rules tab.conditional_forms_2
  2. To add a new rule, click the Add (+) button under the Rules List. Each rule may have one or more Criteria and one or more Actions that occur when the rule is triggered.
    conditional_forms_3
  3. Under the Criteria section, click New to define new criteria. On this screen, you specify conditions that trigger the rule and operator.
    conditional_forms_4
    You can create conditions on the following:

    • Field Name – Use a field from the dropdown selection to set the criteria.
    • Parameter – Enter a parameter to set the criteria.
    • Value – Enter a value to set the criteria.

    Note that only standard, editable fields may be used in Criteria and the following cannot be used:

    • File Fields, Calculated Fields, CAPTCHA, and Distance Search fields
    • Smart fields, such as Timestamp and Password
    • Secondary field used in multiple search criteria (such as in Date Range)
    • Localized Number and Date fields, such as dd/mm/yyyy formatted date.
    • HTML Blocks

    Next, select the appropriate option in the Operator field. Finish the condition by defining the final part of your criteria, such as an expected value in the Value field in order to trigger an Action. The criteria may look like this:

    conditional_forms_5

    Click OK.

  4. A new criteria is added to the Criteria section. Once your Criteria is set up, you can define the Action that will occur when the rule is triggered.conditional_forms_6
  5. Under the Actions section, click New. You can choose to hide, disable, or require in the Action field and specify the field or section in the Field or section field to make the condition.
    conditional_forms_7
    To create multiple criteria for each rule, click the New button to add another criteria, and then confirm the match type:

    • Select match all criteria (AND) if all criteria must be met to trigger the rule.
    • Select match any criteria (OR) where any of the criteria can be true to run the rule.

    To create a rule for multiple fields, insert a Section containing the appropriate fields and apply the Action to the section.

    conditional_forms_8

Applying Actions

You can specify the following actions.

ActionDescriptionApplied toAvailability
HideHides the field or sectionFields
Sections
Search form
Submission form
Details page
Single record update
DisableDisables field or section, where the form element is still visible but is no longer editableFields
Sections
Search form
Submission form
Details page
Single record update
RequireMakes the field requiredFieldsSubmission form
Details page
Single record update
StaticMakes the field static (display-only)FieldsDetails page
Single record update

 

Action Limitations

Note that only standard editable fields may be used in Actions, and the following cannot be used:

  • Required fields
  • Display Only fields
  • Section with Required fields
  • The same field or section already used in another Action
  • Calculated Fields, CAPTCHA, and Distance Search fields
  • HTML Blocks
  • Hidden or smart fields (Timestamp, AutoValue, ViewIncrement)
  • Static action on Password fields
  • Secondary field used in multiple search criteria (such as in Date Range)

Frequently Asked Questions

Why I don’t see a field in the Criteria list?
Only standard editable fields may be used in the Criteria. See the Criteria Limitations section listed above for elements that cannot be used in Criteria.

Why don’t I see a field or section in the Action list?
A common reason why a field is not appearing in the Action list is because it is set to display-only or required. Also, each field or section can be used only in one action (and therefore will no longer appear in the dropdown list). See the Action Limitations section listed above for elements that cannot be used in actions.

How do I create a rule for multiple fields?
To create a rule for multiple fields, insert a Section containing the appropriate fields and apply the Action to that section.

How can I define several actions for the same field?
First create a Section that includes the field. Apply one Action to the field and another Action to the Section.

How can I hide fields displayed across multiple columns?
When displaying fields on the same line or across multiple columns, hiding them will create a blank space in those cells. In this case, it may be preferred to disable those fields rather than hide them.

Why did my rule disappear?
A rule is deleted if you remove the conditional field from your form.

How do I show fields?
If you want to conditionally show fields in your form, you first have to display all the available fields, and then define a rule to initially hide them. For example, hide the field when it is Not Equal to the value.

Here is a list of common operators you might use to show/hide fields:

Operator to show fieldsOperator to hide fields
EqualNot Equal
CheckedNot Checked
Less thanGreater Than
Greater thanLess than
ContainsDoes Not Contain