What am I doing wrong? Arcade to populate year from editor tracking

213
1
02-12-2020 08:00 AM
ThomasColson
MVP Frequent Contributor

I have a YEAR field, controlled by a domain (1950-2030). The user can choose to pick a year from the picklist or do nothing, in which case

Year($feature.CREATEDATE)

will populate the year correctly. 

But if I use 

if ($feature.YEAR == null)
Year($feature.CREATEDATE)
else $feature.YEAR

and do not pick a year from the picklist, nothing happens. The year is not populated.

So what I'm trying to do is have Arcade ignore the user input, but if the user inputs nothing, perform the calculation.

0 Kudos
1 Reply
MikeMillerGIS
Esri Frequent Contributor

Try the IsEmpty function around $feature.year instead of == null