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 {{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.
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.
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
Repeating Data
TABLE OF CONTENTS Using the Repeat Rows Approach REPEATROW rows outputting out of order Advanced Use: Outputting multiple repeats per row Using the Repeating Sections Approach Advanced Use: Outputting multiple repeats per section Nested Repeats ...
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. ...
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 ...
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 ...
Table Field Type
Table fields provide an inline tabular display of repeating data, along with the ability to add & edit rows in the Table via a dedicated row page. Users add rows via a dedicated "Add New Row" button and can edit existing rows by tapping on the ...