Attribute Assistant - generate unique id based on domain value in another field

155
8
Jump to solution
06-24-2020 01:39 AM
Labels (2)
Highlighted
New Contributor II

I have parcels with different landuse classes: Business, Residential, etc. I would like to generate a unique id when the parcel is being split. However, I need to generate a different id and counter depending on the landuse class. If Business, then generate B1, B2, B3, etc. If Residential, then generate R1, R2, R3, etc.

This is my progress.

Table NameField NameValue MethodValue InfoOn Create
ParcelPLOT_IDGENERATE_IDCOUNTER_BTRUE
ParcelPLOT_IDGENERATE_IDCOUNTER_RTRUE
ParcelPLOT_IDEXPRESSIONIIf([TYPE]="Business","B" & [PLOT_ID],"")TRUE
ParcelPLOT_IDEXPRESSIONIIf([TYPE]="Residential","R" & [PLOT_ID],"")TRUE

I could not figure out how to trigger it. Any help would be appreciated.

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Regular Contributor

You can use one seq and put that value in the field and then use an expression to put the proper prefix

View solution in original post

Reply
0 Kudos
8 Replies
Highlighted
Esri Regular Contributor

Is the layer subtyped by the type? If so you can specify that in the Table Name, such as Parcel|1. Without that, you cannot use different sequences.

Reply
0 Kudos
Highlighted
New Contributor II

Unfortunately it is not subtyped. 

So, what if both IDs share the same sequence? For example the sequence is B1, B2, B3, R4, R5, R6. If I split R6, I'll get R7. Is that possible?

Reply
0 Kudos
Highlighted
Esri Regular Contributor

You can use one seq and put that value in the field and then use an expression to put the proper prefix

View solution in original post

Reply
0 Kudos
Highlighted
New Contributor II

I tried this, but I am not getting expected results.

Table NameField NameValue MethodValue InfoOn CreateRule Weight
ParcelPLOT_IDGENERATE_IDCOUNTERTRUE1
ParcelPLOT_IDEXPRESSIONIIf([TYPE]="Business","B" & [PLOT_ID],IIf([TYPE]="Residential","R" & [PLOT_ID]))TRUE0
Reply
0 Kudos
Highlighted
Esri Regular Contributor

Syntax is not complete, iif(statement, what to do when true, what to do when false)

IIf(="Business","B" & ,IIf(="Residential","R" & ,))

Reply
0 Kudos
Highlighted
New Contributor II

OK. I tried this with the cut polygon tool but I only get the sequence without the prefix.

Table NameField NameValue MethodValue InfoOn CreateRule Weight
ParcelPLOT_IDGENERATE_IDCOUNTERTRUE1
ParcelPLOT_IDEXPRESSIONIIf([TYPE]="Business","B" & [PLOT_ID],IIf([TYPE]="Residential","R" & [PLOT_ID], [PLOT_ID]))TRUE0
Reply
0 Kudos
Highlighted
Esri Regular Contributor

Need to turn the log file on and see what it says

Reply
0 Kudos
Highlighted
New Contributor II

The log is very useful. I found my mistake. Accidentally changed the value method. It is working now. Thanks a lot.

Reply
0 Kudos