Making fields in a repeating table required

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.

  1. Add a hidden field inside the table field {{tally}} with the following Dynamic Value, with {{field}} being the data name of the field inside the table:

    IF({{field}}!='',1,0)

    This will enumerate a value of 1 if there is a value present but keep it at 0 if nothing has been entered.

  2. Add another hidden field outside the table {{count}} with the following in the dynamic value:

    SUM({{tally}})

    This will sum up the value of the {{tally}} fields inside the table.

  3. Add a text field or another field beneath the hidden field above with something like this in the Default Value property, ensuring that the Required and Read Only checkboxes are ticked:

    Please enter (such and such) above

    You might also include a Visibility rule to show the field only if {{field}} has not been filled out:

    {{field}}!=''

    Then add following in the Custom Validation property:

    {{count}}>0

    Also add something like this in the Validation Message property:

    Please enter (such and such) above

    This will force the user to stop and add a value to the table field if no rows have been added -- i.e., if the value of {{count}} is less than 1.
    • Related Articles

    • Concatenating Repeating Fields from a Table within the Form

      Concatenating multiple values entered in a repeating table for use or display elsewhere in the form can be done with the following procedure. First create a hidden field inside the table - e.g., {{tally}} - that uses a simple IF statement like this ...
    • 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. ...
    • Controlling Required Fields

      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. ...
    • Table Field

      The Table field is an advanced field that allows you to capture and display repeating data sets in a tabular format. Rows can be added or prepopulated from a data source and edited by viewing all row column data or directly viewing them on the table ...
    • Nesting Repeatable Data - Nested Repeating Tables

      Capturing repeatable data using a repeating Table field is amazing, However, sometimes, you need to group data within other data, like putting a smaller box inside a bigger box. In the app builder, you can do this by nesting one Table Field inside ...