I try to clean up an attributetable using calculate field and arcade, some records have their creator in a column 'creator_1' instead of creator so I wrote:
IIf(IsEmpty($feature.Creator),$feature.Creator_1,$feature.Creator)
But all I get is: Invalid expression. error on line 1. Open parenthesis expected
I've looked at the arcade reference and other sources I could think of but I can't see what i'm doing wrong. ArcGIS PRO 2.5.1
your help would be appreciated!
regards,
Bert
Solved! Go to Solution.
Hello Dan and Xander,
Sorry it took a while before i could get back on this, thanks for both your reactions.
I found this to do what I wanted:
if creator is empty copy value from creator_1 else take current value.
Unclear why the else is needed but if i omit that the field gets emptied (null)
Is there a arcade for dummies somewhere? I can't find much help from the reference
Bert
Creator_1 isn't in your list Creator1 is and it looks like you are trying to calculate into Creator and use its value at the same time.
Hi Bert Kraan ,
In addition to what danretired already mentioned, it is important to select the fields you use from the list above, to be sure that you are using the correct field names. In some implementations of Arcade a field with an underscore need to be addressed like $feature["Creator_1"]. Just so you know. But I suppose following the advise of Dan should solve your problem.
Hello Dan and Xander,
Sorry it took a while before i could get back on this, thanks for both your reactions.
I found this to do what I wanted:
if creator is empty copy value from creator_1 else take current value.
Unclear why the else is needed but if i omit that the field gets emptied (null)
Is there a arcade for dummies somewhere? I can't find much help from the reference
Bert
Don't see one for 'dummies' but this is the documentation that I refer to
Getting Started | ArcGIS for Developers
Arcade Function Reference | ArcGIS for Developers