Attribute Assistant: Generating Null Values

1737
7
05-23-2017 01:05 PM
PhilWatson
New Contributor II

I am using the Attribute Assistant tool to automatically generate values for certain fields using the Value Method FIELD_TRIGGER.  I'm running into trouble when I want to use FIELD_TRIGGER to change the value of a field to be null. I have no problems writing a rule that generates a regular string or number value, but I can't figure out how to generate a null value. 

When I use the Value Info of "Field Value|Field to Change|<Null>", it will put "<Null>" into any string fields I write the rule for, but I don't think this is a true null value because it doesn't work on number or date fields.  I have tried countless variations on <Null> (<null>, "<Null>", null, isNull, etc) and none of them work.

After reading the documentation on Attribute Assistant, it looks like FIELD_TRIGGER might only return a number or string value.  Has anyone figured out how to return true null values for fields using the attribute assistant?

You can see my specific rule in the attachment.

0 Kudos
7 Replies
IanMurray
Frequent Contributor

You probably need to use a None, not a NULL.

http://pro.arcgis.com/en/pro-app/tool-reference/data-management/calculate-field-examples.htm#ESRI_SE...

See last example.

(I know nothing about Attribute Assistant, but this seemed relevant)

Edit: See also https://community.esri.com/docs/DOC-8284

0 Kudos
PhilWatson
New Contributor II

Thanks for the suggestion, although it didn't work.  Attribute Assistant is a strange beast.  There are a few instances where it reacts to VB syntax, but in this case, the value info field seems to be treating everything as straight text or numbers, not code.

0 Kudos
PhilWatson
New Contributor II

Michael Miller‌ is there any plans to introduce the ability to add null values? I came across an old thread where you considered adding the ability to use FIELD_TRIGGER for dates https://community.esri.com/thread/62983

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

You can use Expression to add null values.  

PhilWatson
New Contributor II

Thanks for the tip. I was able to accomplish getting a null value using this in the Value Info field:  IIF([STATUS]=2,"<Null>",[DIAMETER])

I have the rule set to run on attribute change, so it is a bit weird that as long as the expression rings true it will constantly overwrite any changes I attempt to make.  I was originally hoping to use FIELD_TRIGGER because it only runs at the moment the specific field is changed.  EXPRESSION will run anytime I change any field, as long as the expression is valid.  I guess I could move it to manual-only.  I will have to play with it and see what works best.

Thanks,

Phil

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

I see, would not be hard to extend field trigger to set <Null> as null

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

I made the change in the source already, just need to test and I can push it to a preview build for you to try out.

Enhancement - Field Trigger - Support setting null · Issue #243 · Esri/local-government-desktop-addi...