Calculation working in survey123 app but not with the web survey

188
1
04-02-2020 06:02 PM
yaserkhouja
New Contributor II

When I try to calculate the fields with "or" as the example below: 

number(${t_n95masks_s})+ number(${r_n95masks_s}) or number(${t_n95masks_s})- number(${u_n95masks_s})

the calculation work fine in the survey123, but if i submit the survey with a web version then the field return true or false value. Anyone know why this hapens?

Thanks,

Tags (2)
0 Kudos
1 Reply
Jim-Moore
Esri Regular Contributor

Hi Yaser


The 'or' operator evaluates two expressions and returns 'true' if either of the expressions is true. If set up correctly an 'or' expression should return true or false. For example, you could use an expression like the one below in the relevant column to show/hide a question if either of the expressions is true, or use it inside an if() statement:

${age} < 20 or ${age} > 60

XLSForm operators are listed here: Formulas—Survey123 for ArcGIS | Documentation  

 You cannot use 'or' to substitute one calculation or value for another.

Could you please provide some more detail on what you're trying to achieve with the calculation and what your expected result is so I understand the logic? If you could share your XLSForm that would be useful; you can attach files to your post using the 'advanced editor'.


Best regards,

Jim

0 Kudos