Hi y'all!
I'm trying to force a field to be written in capital letters ONLY. I've tried to use de expression regex(.,'^[A-Z]*$') in the Calculate column, however I have the following error as I try to publish the survey:
b'ODK Validate Errors:\n>> Something broke the parser. See above hor a hint.\nDependency cycles amongst the xpath expressions in relevant/calculate\n\nResult: Invalid'
Do you know why?
I've tried to fixed and can't find a solution.
Thanks!
Solved! Go to Solution.
The attached XLSForm worked for me.
The error message you are getting indicates that you are creating an endless cycle with your expression. If you put the regex expression in the calculation column, you will indeed create an endless cycle because your regex expression is trying to use the user text in the same line where your regex runs.
You want to put the regex expression in the constraint column. The constraint expression is evaluated in the mobile app when you try to submit the form.
The attached XLSForm worked for me.
The error message you are getting indicates that you are creating an endless cycle with your expression. If you put the regex expression in the calculation column, you will indeed create an endless cycle because your regex expression is trying to use the user text in the same line where your regex runs.
You want to put the regex expression in the constraint column. The constraint expression is evaluated in the mobile app when you try to submit the form.
Thank you @IsmaelChivite!
How can I also include space between words as and acceptable value?
I used the regex expression in the constraint column as sugested, but I didn't think about the spaces between words and now I have that error.
Try this expression, it allowed me to enter multiple capitalized words: regex(${example1},"^[A-Z]*")
Thank you! This was actually very helpful.