Survey123 Form calculations not working properly on Web App, but fine in survey123 connect

195
2
Jump to solution
05-29-2019 03:51 PM
Highlighted
New Contributor II

I am trying to code into a Survey123 form a work around for the lack of Captcha functionality but I am having issues with the display of the web browser version of the app.  My work around involves generating a random number at the top of the form to use as a password at the bottom to complete submission.  However, the random() function has 15 significant figures and I would prefer survey takers not have to deal with that large of number.  When I use round() to reduce the length of the number it works for the Survey123 Connect app, but displays "NaN" in the web browser app. 

Is there a way to take a calculated value like "round(random(),6))" and have it display as a value other than "NaN" in the web version of survey123? 

Images 1 and 2 show the formula and output of one of the round() function related tries.  Images 3 and 4 show the output when using only the "random()" function. 

What is interfering with the proper display on the web version of Survey123? 

1 Solution

Accepted Solutions
Highlighted
Esri Esteemed Contributor

Hi,

One way work with the random() in this context would be to multiply the value by number of digits you do want and then round() the number to make an integer:

round(random()*100000000,0) 

for 8 digits as an example

View solution in original post

2 Replies
Highlighted
Esri Esteemed Contributor

Hi,

One way work with the random() in this context would be to multiply the value by number of digits you do want and then round() the number to make an integer:

round(random()*100000000,0) 

for 8 digits as an example

View solution in original post

Highlighted
New Contributor II

Thank you - this advice solved the problem.  My hacky CAPTCHA work around is now functional.  

Reply
0 Kudos