Can IIf() handle a conditional expression with more than one clause?

472
2
Jump to solution
02-11-2022 08:30 AM
Labels (1)
AmyRoust
Occasional Contributor III

I need to write an Arcade statement that evaluates the values in more than one field before deciding if the expression is true or false. I'm testing in Pro without success, but since my end product will be in ArcGIS Online, I thought I'd post in this community.

The expression is basically like this:

IIf(textField=='Yes' and IsEmpty(dateField), 'TRUE', 'FALSE')

 

In Pro, I keep getting an error message saying Close parenthesis expected. I tried wrapping the whole expression in parentheses like this:

IIf((textField=='Yes' and IsEmpty(dateField)), 'TRUE', 'FALSE')

 

But I still get the same error message.

Is it possible that IIf() cannot evaluate true/false when the statement has multiple clauses?

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

You have to use "&&" instead of "and". Take a look at the list of Operators.

 

IIf(textField=='Yes' && IsEmpty(dateField), 'TRUE', 'FALSE')

 

 

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

You have to use "&&" instead of "and". Take a look at the list of Operators.

 

IIf(textField=='Yes' && IsEmpty(dateField), 'TRUE', 'FALSE')

 

 

AmyRoust
Occasional Contributor III

Oh my gosh. I feel foolish! Thank you for the syntax correction! I was moving back and forth between Arcade and SQL and got my operators mixed up.

0 Kudos