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.
Solved! Go to Solution.
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.
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
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.
This worked perfect! Thank you for the script & explanation, Jen!