Select to view content in your preferred language

arcade in attributetable

862
4
Jump to solution
05-25-2020 01:46 AM
BertKraan1
Frequent Contributor

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

0 Kudos
1 Solution

Accepted Solutions
BertKraan1
Frequent Contributor

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

View solution in original post

0 Kudos
4 Replies
DanPatterson
MVP Esteemed Contributor

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.


... sort of retired...
XanderBakker
Esri Esteemed Contributor

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.

0 Kudos
BertKraan1
Frequent Contributor

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

0 Kudos
DanPatterson
MVP Esteemed Contributor

Bert Kraan‌ 

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 


... sort of retired...