Conditionally Required Fields (Required Condition)

Conditionally Required Fields (Required Condition)

The standard Required and Read Only option on the Form designer lets you define fields that are always required or read-only respectively. However, sometimes you need to make a field required or read only based on the answer(s) to a previous field. This is when you should use the Required Condition and Read Only Condition properties. Both these properties work exactly the same way; so, for ease, we're just going to refer to Required Condition in the rest of this recipe. Everything below applies equally to the Read Only Condition.

Required Condition allows you to define a formula that will control whether or not the field is required. It works in a very similar way to the Visibility property, just for required-ness. Let's assume your Form design currently has a "Do you have any hazards?" field with Data Name of "seeHazards." Also assume that the seeHazards field has the values "Yes" and "No" as available option answers.

  1. Add a new Text field to your Form design under the seeHazards field.
  2. Give the new field a Data Name such as "hazardsDescription."
  3. Find the Required property on the new field, then click the "add condition" link to the right.
  4. This will hide the standard Required checkbox and show the Required Condition formula field.
  5. Now we need to create a formula that will give a True or False result.
    • When the formula result is True, the field will become required.
    • When the result is False, the field will not be required.

Enter the following formula into the Required Condition property:

{{seeHazards}} = 'Yes'

What the above means is that when the seeHazards field is answered with a value of Yes, then the hazardsDescription field will be required. The user will not be able to proceed until they have filled out something in the hazardsDescription. Save your Form and Test it on your device to see the conditionally required functionality in action.


    • Related Articles

    • Making fields in a repeating table required

      The following workaround can be used to enforce that a field within a repeating table be required for the user to complete, even if the table is not required. Add a hidden field inside the table field {{tally}} with the following Dynamic Value, with ...
    • Importing Fields from Excel

      When you need to create a big form with many questions, it can be time consuming to build all of these in our Form Designer. In most cases, the form that you are creating already exists as a Word or Excel file that is being printed out. That file ...
    • Showing and Hiding Fields (Visibility)

      There are many situations where you may want to show/hide fields (or even whole pages) based on the answer to a previous question. For example, say we have a Choices field that asks "Do you see any hazards?", with the options of Yes or No. Now if the ...
    • Gallery Field Type

      TABLE OF CONTENTS Layout & Styling Background Color Validation & Behavior Required Validation Behavior Gallery Item Limits Output Gallery Field Data in a Custom Word/Excel Template This is an advanced field type that allows a user to upload multiple ...
    • Calculating the difference between two date/time fields

      To calculate the difference between two date/time fields, create hidden fields that convert the time/date values gathered by time/date fields into a specific format using FORMAT-DATE. Then create another hidden or visible field with a dynamic value ...