Select to view content in your preferred language

Using an IF statement in calculations

556
2
Jump to solution
11-21-2023 10:00 AM
CamKenny2
Occasional Contributor

I have a select one question in my survey and depending on which one is selected, I'd like to present the user a message.

I have created a text field where I am performing a calculation using an IF statement.

The trouble is, I would like to use a BUT, but I don't know what the syntax is for that - even if it is possible.

if(${header_mode}='new' and ${Flight_Status}='Post-Flight','You must complete the Pre-Flight Checklist before selecting Post-Flight','Please complete the Pre-Flight Checklist in its entirety') BUT (if(${header_mode}='edit' and ${Flight_Status}='Pre-Flight','The Pre-Flight Checklist has been completed, please complete the Post-Flight Checklist',''))

The first part of the IF statement works, but when I edit an existing survey, it doesn't execute the second IF statement.

 

Tags (2)
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

I think the easiest way is to just make 2 different note fields.  One for each side of the but.  Have you tried that?

View solution in original post

2 Replies
DougBrowning
MVP Esteemed Contributor

I think the easiest way is to just make 2 different note fields.  One for each side of the but.  Have you tried that?

rwrenner_esri
Esri Alum

I'll second what Doug said, although if you want to do everything in a single field you could use or as the operator. 

https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm#ESRI_SECTION1_276FB77...