I am getting the error
'Invalid expression.
Error on line 2.
Close parenthesis expected'
that I can't seem to figure out. This is a fairly straight forward expression asking if the contents of field LP1 = [a,b,c,d] return 'Yes' else return null. Can you help me identify its error?
var owned = ['a','b','c','d'];
var v = iif($feature.LP1 in owned,"Yes", null);
return v;
Thanks for the help..
Solved! Go to Solution.
Are you trying to see if LP1 contains one of those four values or the array "['a','b','c','d']"?
If you're checking if it contains one of those values, then you'll use the Includes function in your iif.
var owned = ['a','b','c','d'];
var v = iif(Includes(owned, $feature.LP1),"Yes", null);
return v;
Are you trying to see if LP1 contains one of those four values or the array "['a','b','c','d']"?
If you're checking if it contains one of those values, then you'll use the Includes function in your iif.
var owned = ['a','b','c','d'];
var v = iif(Includes(owned, $feature.LP1),"Yes", null);
return v;
Thanks @KenBuja, my 'Include' was in the wrong position and syntax.
var owned = ['a','b','c','d'];
var v = iif(Includes(owned, $feature.LP1),"Yes", null);
return v;