Attribute Assistant

982
4
Jump to solution
09-16-2019 09:26 AM
Labels (3)
GIS_geek
New Contributor III

I am trying to set a condition using Attribute Assistant.  I have a feature layer (GPS_Meter) with a field called SYSTEM.  The SYSTEM field is populated with Potable, Non-Potable, and Sewer.  I am trying to auto populate another field (UID) with either DW, RW, or SS and the OBJECTID. I have the following populated in the DynamicValue table,

Table Name: GPS_Meter

Field Name: UID

Value Method: EXPRESSION

Value Info: IIF([SYSTEM]=Potable, "DW", IIF([SYSTEM]=Non-Potable, "RW", IIF([SYSTEM]=Sewer, "SS"))) & [OBJECTID]

I run AA for selected GPS_Meter points and the UID field does not get populated.  Any help will be greatly appreciated.

0 Kudos
1 Solution

Accepted Solutions
GIS_geek
New Contributor III

Thank you all for your help.  I had the last part of the IIF statement incorrect.  I removed the IIF([SYSTEM]="Sewer" and it worked.  Below is the updated expression

IIF([SYSTEM]="Potable", "DW", IIF([SYSTEM]="Non-Potable", "RW", "SS")) & [OBJECTID]

View solution in original post

0 Kudos
4 Replies
PaulLeBlanc1
Esri Contributor

Is the SYSTEM field text? You'll need to enclose the values in quotes:

IIF([SYSTEM]="Potable", "DW", IIF([SYSTEM]="Non-Potable", "RW", IIF([SYSTEM]="Sewer", "SS"))) & [OBJECTID]

GIS_geek
New Contributor III

Paul,

Thanks for the reply.  It is a text field.  I added the quotes and still getting no results.  The UID field does not get populated.

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

IIF was monkeypatched in the msscriptcontrol.  I believe you need to do & inside it.  I have never tested this.  The logic may not work and you might need a second expression statement that fires after this one.  Which is <The Edited Field> & [OBJECTID]

 IIF([SYSTEM]=Potable, "DW" & [OBJECTID], IIF([SYSTEM]=Non-Potable, "RW" & [OBJECTID], IIF([SYSTEM]=Sewer, "SS" & [OBJECTID]))) 

GIS_geek
New Contributor III

Thank you all for your help.  I had the last part of the IIF statement incorrect.  I removed the IIF([SYSTEM]="Sewer" and it worked.  Below is the updated expression

IIF([SYSTEM]="Potable", "DW", IIF([SYSTEM]="Non-Potable", "RW", "SS")) & [OBJECTID]

0 Kudos