b'ODK Validate Errors - Surve123 Connect/ Regex expression

520
4
Jump to solution
01-19-2024 08:41 AM
DianaTorres10
New Contributor III

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!

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

The attached XLSForm worked for me.

IsmaelChivite_0-1705683758716.png

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.  

View solution in original post

4 Replies
IsmaelChivite
Esri Notable Contributor

The attached XLSForm worked for me.

IsmaelChivite_0-1705683758716.png

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.  

DianaTorres10
New Contributor III

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.

 

0 Kudos
MarikaVertzonis
Esri Regular Contributor

Try this expression, it allowed me to enter multiple capitalized words: regex(${example1},"^[A-Z]*")

MarikaVertzonis_0-1705883116282.png

 

DianaTorres10
New Contributor III

Thank you! This was actually very helpful.

0 Kudos