Can't return Null when using Attribute Rule (edit/Update) and arcade

149
3
02-06-2020 03:01 PM
Highlighted
by
Occasional Contributor III

While Null now works in arcade field calculations on Pro 2.5, it still does not work in Attribute Rules while using the edit keyword and update.

Attribute rule dictionary keywords—Geodatabases | Documentation 

return {
"result": $feature.assetid,
"edit": [{
"className": "electricdistributionassembly",
"updates": [{
"objectID": feature_objectid,
"associationType": Null
}]
}]
}‍‍‍‍‍‍‍‍‍‍

The above code will not work.  It returns a what I am guessing is an empty field.  It does not work on strings or dates.

I need a simple attribute rule that updates a field to "Something" on insert/update and to <Null> on insert/update on "Something Else"

My code works except that there is no way to return Null using Attribute Rules & Arcade.  You can return a string, date or 0 (in the case of dates 12/30/1899).

I have set to Null and tried to set it to a field that is Null.

Reply
0 Kudos
3 Replies
Highlighted
New Contributor II

I am having the exact same problem and came on here to check.

I basically want to have a safety mechanism set to where the field users are protected from accidentally typing in the wrong date field in Collector, since we have multiple date fields.

I'm getting the same weird date of 12/30/1899 as well. Here is how my attribute rule is set

Have you heard anything on this yet?

Reply
0 Kudos
Highlighted
by
Occasional Contributor III

I am actually trying to edit a different feature class using "Edit", which still does not work.

What you are doing does work:

{
return Null;
}

Highlighted
New Contributor II

Yep, that did the trick. Thanks for the help!

Reply
0 Kudos