Constraints for total characters that can be entered

I am unsure of the constraint syntax that needs to be used to enter a string of characters within a particular size. I've used the syntax given below:
|type|name|label|hint|constraint|
|text|reas_diss|What are the reasons of your dissatisfaction?|Specify in 100 characters|(string_size(${reas_diss})<=100|

Please help/suggest an improvement.

You can use this constraint: regex(.,'^\S{2,2}.{0,100}$')

It allow at least two and maximum 100 character. You can modify the regex.

1 Like

regex will work and you can learn more about those at https://docs.opendatakit.org/form-regex/.

And you can also use string-length(). More about that at https://docs.opendatakit.org/form-operators-functions/#searching-and-matching-strings

1 Like

Thank you. This helped a lot.

Thank you. I used string_length(). But this may be useful at other times.

1 Like