calculate values in an if statement in survey 123

265
2
Jump to solution
03-13-2019 12:28 PM
Occasional Contributor

I'm trying to write a simple if statement in a survey123 form that will perform a calculation if the condition is true and perform a different calculation if the condition is false. It places a string of junk in the calculated field, instead of calculated values, if I remove the calculations the if statement works just fine. Can anyone help me on this?

if(${Static_Water_Level}<(${Installed_Depth} - ${Screen_Height}), ${Installed_Depth} - (${Screen_Height}div2), ${Static_Water_Level} + ((${Installed_Depth} -${Static_Water_Level})div2))
Tags (1)
Reply
0 Kudos
1 Solution

Accepted Solutions
Esri Esteemed Contributor

Hi Grant,

It looks like there are no spaces in the calculations - you should separate parts by space (i.e., ${Screen_Height}div2  should be ${Screen_Height} div 2 ).  That allows calculations to work in my testing.

View solution in original post

2 Replies
Esri Esteemed Contributor

Hi Grant,

It looks like there are no spaces in the calculations - you should separate parts by space (i.e., ${Screen_Height}div2  should be ${Screen_Height} div 2 ).  That allows calculations to work in my testing.

View solution in original post

Occasional Contributor

That worked! Thanks for your help.

Reply
0 Kudos