Calculation works in Connect but not in the Web Browser

640
3
Jump to solution
01-23-2023 04:22 PM
Symbology2008
New Contributor II

Using an "if selected" calculation to auto populate a select multiple field. Works great in Connect (video attached), but does not work in the web browser. Submitted surveys log a value of "true", not the expected csv string. Is there different syntax I should be using in the calc column?

Connect version 3.13.249

xlsx attached. if statement in row 23.

 

0 Kudos
1 Solution

Accepted Solutions
JenniferAcunto
Esri Regular Contributor

The web browser is not as forgiving as Connect and the field apps are. You need to chain your if statements together instead of trying to OR them. 

Each if statement is the 'else' choice for the proceeding if statement until you arrive at the end. That is where you then add the default option if none of your if statements are true. 

Ex.

if(${status}='good', 'green', if(${status}='ok', 'yellow', if(${status}='bad', 'red', 'white')))

What that statement is saying is 'if the status is good, give me red, if not check if it's ok and give me yellow. If it's not yellow, check if it's bad and give me red. If not, then give me white. 

- Jen

View solution in original post

3 Replies
Richard_Purkis
Esri Contributor

Hi @Symbology2008 

I was able to recreate the issue with your form at 3.16

Playing around with it I got it to work (after simplifying) by changing the format of the calculation to if(${HHS_REGION}=1, '20120','')

I couldn't find documentation on this to know if this was expected or not. Perhaps someone could advise but this should work for you now

Hope this helps

JenniferAcunto
Esri Regular Contributor

The web browser is not as forgiving as Connect and the field apps are. You need to chain your if statements together instead of trying to OR them. 

Each if statement is the 'else' choice for the proceeding if statement until you arrive at the end. That is where you then add the default option if none of your if statements are true. 

Ex.

if(${status}='good', 'green', if(${status}='ok', 'yellow', if(${status}='bad', 'red', 'white')))

What that statement is saying is 'if the status is good, give me red, if not check if it's ok and give me yellow. If it's not yellow, check if it's bad and give me red. If not, then give me white. 

- Jen
Symbology2008
New Contributor II

This worked perfect! Thank you for the script & explanation, Jen!

0 Kudos