AnsweredAssumed Answered

Are Boolean and mathematical operators allowed in the same formula? (Or & div)

Question asked by elliott.plack2 on Feb 12, 2019
Latest reply on Feb 13, 2019 by JTedrick-esristaff

I'm working on a survey that calculates the value radius based on a diameter value that changes depending on another part of the form. In Survey123 Connect on Windows the first scenario works but it does not work on a web form. The second scenario works in both Windows and the web. Should the first one work in both places? 

 

It appears the inner parentheses is always evaluated to 1 in scenario 1, regardless of the terms.

 

Scenario 1: Round Pipe with Boolean

variables

decimal DIAMETER_ROUND set to 5.5

decimal HORIZONTAL is null and hidden by relevancy

 

formula

double RADIUS calculate (${DIAMETER_ROUND} or ${HORIZONTAL}) div 2

 

results

Windows: 2.75 (correct)

Web form: 0.5 (wrong)

 

Scenario 2: Round Pipe with if/then

variables

decimal DIAMETER_ROUND set to 5.5

decimal HORIZONTAL is null and hidden by relevancy

 

formula

double RADIUS calculate if(${PIPE_SHAPE}="round",${DIAMETER_ROUND} div 2,${HORIZONTAL} div 2)

 

result

Windows: 2.75 (correct)

Web form: 2.75 (correct)

Outcomes