Select to view content in your preferred language

calculate values in an if statement in survey 123

1340
2
Jump to solution
03-13-2019 12:28 PM
GrantHaynes
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)
1 Solution

Accepted Solutions
JamesTedrick
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
JamesTedrick
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.

GrantHaynes
Occasional Contributor

That worked! Thanks for your help.

0 Kudos