Attribute Assistant: Populate Field if NULL

3590
5
Jump to solution
11-27-2012 09:17 AM
Labels (1)
MikeLong
New Contributor III
We have a field (EventID) in our database (APDM) that behaves as the unique identifier for each feature .  We have used a class extension that would generate a GUID value and populate this field only if the field was NULL.  Is it possible to have Attribute Assistant behave in this same fashion?  I have tried using the GUID option, the Copy Field option and even the Expression option (IIF [EVENID] is Null, [GlobalID] else "Do Nothing")(this is not the exact expression I used).

Any ideas on how we might be able to do this?

-Mike
0 Kudos
1 Solution

Accepted Solutions
MikeMillerGIS
Esri Frequent Contributor
You could use the Expression method to detect a null field

try this

IIF(IsNull([EventID]),[GlobalID],[EventID])

View solution in original post

0 Kudos
5 Replies
MikeMillerGIS
Esri Frequent Contributor
You could use the Expression method to detect a null field

try this

IIF(IsNull([EventID]),[GlobalID],[EventID])
0 Kudos
JeremiahMartin
New Contributor II

I have tried the same thing, but I get a Type Mismatch error.  Do you know what might cause this?

Row Info
Row Number 29
TableName: Building
FieldName: CityVillage
ValueInfo: IFF(isNull([CityVillage]), [Township], [CityVillage])
ValueMethod: EXPRESSION
On Create: 1
On Change: 1

Checking for Subtype Restriction
Field Name: City Village was found at index: 20
Trying: EXPRESSION
replace field: Township with a value
replace field: CityVillage with a value
replace field: CityVillage with a value
Checking to verify there is a field to store the expression
Expression to be eval: IFF(True, "OAKLAND", "")
ERROR: evaluating the expression for feature in Building with OID of 15859
System.Runtime.InteropServices.COMException (0x800A000D): Type mismatch: 'IFF'
at MSScriptControl.ScriptControlClass.Eval(String Expression)
at ArcGIS4LocalGovernment.AttributeAssistantEditorExtension.SetDynamicValues(IObject inObject, String mode, List`1& ChangeFeatureList, List`1& NewFeatureList, List`1& ChangeFeatureGeoList) in C:\Projects\GitHub\local-government-desktop-addins\Attribute Assistant Add In\AttributeAssistantAddIn\AttributeAssistantEditorExtension.cs:line 12514
Finished: EXPRESSION

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

It is IIF, not IFF, give that a shot

0 Kudos
JeremiahMartin
New Contributor II

I'm an idiot!  That was it.  I stared at this forever and didn't catch that.

You rock and thanks for the fast reply!

0 Kudos
MikeLong
New Contributor III
Thanks Mike, that worked.  I had to make a minor change since the destination is a text field.

IIF(IsNull([EventID]),"[GlobalID]","[EventID]")

-Mike
0 Kudos