All Collections
Data
How do I validate what data is entered?
How do I validate what data is entered?

Using min-max and regular expression validations for complex data entry.

Cory MacVie avatar
Written by Cory MacVie
Updated over a week ago

It is possible to validate the data entered to a field through two different methods: minimum/maximum values and validation pattern. The minimum/maximum values can be selected on most field types. Validation pattern leveraging regular expressions can be used on text field types.

Minimum / Maximum Values

As the name describes, this option allows the user to set a minimum and maximum value for the given field. This means that if the data collector user enters an amount that is outside these values, it won't be accepted.

If either one of the values is not provided, then it will allow any value, always respecting the value entered in the other one.

Minimum and maximum values for fields

This option is available for some field types and the type of validation varies based on the field types they are available for. Below is a list of the field types that support this option and their specific validation:

  • Text - Character length for a text field.

  • Numeric - The range of valid numeric values.

  • Multi-Choice - Number of selections that can be made.

  • Photos - Number of photos that can be captured.

  • Videos - Number of videos that can be captured.

  • Audio - Number of audio files that can be captured.

  • Repeatable Sections - Number of child records that can be created.

Notes

  • These settings are only enforced if the field has something captured in it. This does not make the field required to have an entry. If you are looking to enforce that a value is entered then enable the required checkbox option.

Validation Pattern with Regular Expressions  

This option is only supported for Text fields in Fulcrum. It supports custom validation patterns by using a regular expression (regex).

Our validation pattern builder has a few common regular expressions built-in, but you can write your own custom expression to match the desired entered pattern.

To access the Validation Pattern option, select the text field you wish to validate, and then click the VALIDATE PATTERN button available in the field options, right above the minimum and maximum value options.

Defining a Validation Patter for a US phone number

Once you have selected a validation pattern from the ones available or if you created your own, you can use the Test field to verify if your regular expression is working correctly.

Notes

  • You can use a tool like RegExr to build and test your own expressions.

  • If you create a regular expression after you have already collected data, the existing data will not be removed. However, when you edit a record and the value/string stored does not comply with the regular expression, the value/string will have to be edited so that it can be validated.

Did this answer your question?