Select to view content in your preferred language

Syntax for calculations not working

629
6
11-04-2024 02:10 AM
AilsaHenderson
Emerging Contributor

Hi,

I'm using survey123 and trying to add field with a calculation to calculate cost per km based on fuel. When I enter the syntax as in the first screenshot both variables are there but as soon I return to the main screen the "KM driven" field disappears. Can someone help?Screenshot 2024-11-04 110557.pngScreenshot 2024-11-04 110623.png

Tags (2)
6 Replies
ZACHARYSPENCER
Emerging Contributor

I am experiencing the exact same issue, and even when I finally get the correct fields into my calculation, the calculation is not returning values in the survey. Is this a known issue, Esri? 

0 Kudos
ZACHARYSPENCER
Emerging Contributor

I was able to (finally) get the right fields to stick into the calculation window by loading the calculation with extra fields, which ended up getting dropped by the error, but when I do this the calculation fails. 

0 Kudos
AilsaHenderson
Emerging Contributor

Yeah I tried then putting everything in brackets just to get the field to remain but even then they don't always stay or like you said then don't perform the calculation

ZACHARYSPENCER
Emerging Contributor

So, and this is going to sound crazy, but we think we found a work around. If we put the calculation is as we want it, and set it then save and publish it seems to still work even though it doesn't show up in the visualization. 

0 Kudos
ZACHARYSPENCER
Emerging Contributor

But I had to use the trash can icon to clear the form first, then put it in as it should be and saved it. Even though it didn't show up in the right hand side of the survey it still seemed to work. 

0 Kudos
AilsaHenderson
Emerging Contributor

Let me try and come back to you

0 Kudos