Validators

Validators are a feature of editable cell of spreadsheet or table and single field section. Validators allow you to set what value can be typed in this cell. When user types wrong value, cell will be highlighted and an error will be displayed. App instance won't be saved and won't go to the next state, until the user corrects the error.

mceclip13.png 

 

In fact there are 6 types of validators:

1. Required:
(cell type: any except checkbox)
Cell displays an error, when it is empty.
mceclip14.png

mceclip15.png
Parameters:
- Error message (type: text)(optional parameter) - text, which will be shown as an error 

 

2. Conditional:
(cell type: any)
Cell displays an error, when condition given in parameter is not met.

mceclip17.png

mceclip16.png
Parameters:
- Condition (type: logical) - condition, which must be met; condition can be any formula, which returns true or false, formula doesn't have to reference the cell with this validator 
- Error message (type: text)(optional parameter) - text, which will be shown as an error

 

3. Range
(cell type: any except checkbox, attachment and link)
Cell displays an error, when value in it is not in range described in parameters

mceclip4.png
mceclip18.png
Parameters:
- Min (type: the same as cell) - minimum value that the value in cell must have 
- Max (type: the same as cell) - maximum value that the value in cell must have 
- Error message (type: text)(optional parameter) - text, which will be shown as an error

 

4. Email 
(cell type: text, dropdown list, autocomplete)
Cell displays an error, when typed value is not an email.

mceclip20.png

mceclip21.png
Parameters:
- Error message (type: text)(optional parameter) - text, which will be shown as an error

 

5. Restrict to list
(cell type: dropdown list, autocomplete)
Cell displays an error, when value in cell does not exist on the specified list of items.

mceclip22.png
mceclip23.png
Parameters:
- Error message (type: text)(optional parameter) - text, which will be shown as an error

 

6. Regular expression
(cell type: text, dropdown list, autocomplete)
Cell displays an error, when value doesn't match regular expression given in parameters.mceclip24.png

mceclip25.png
Parameters:
- Expression (type: text) - regular expression, which describes correct value in cell. Here - https://regexone.com you can learn more about it.
- Error message (type: text)(optional parameter) - text, which will be shown as an error

Examples of regular expressions:

[0-9]+ - checks if value in cell contains at least one digit
^[0-9]+$ - checks if given value contains only digits
^[A-Z] - checks if text starts with capital letter
^[^ąćęłńóśżź]*$ - checks if value in cell don't have any Polish characters
^[0-9]{2}-[0-9]{3}$ - checks if given value is in postcode format

 

Remarks:

You can use a few validators in one cell, even few validators with the same type. When Error message parameter is empty, default information dependent on the type of validator will be displayed as an error.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk