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.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article