Autonumber in Pro when feature is created in Arcade

08-13-2020 12:27 PM
New Contributor II

I am trying to create an attribute rule in ArcGIS Pro that creates an ID for the feature when it is created as well as choose features with '::' leading the ID and assign a new unique ID. There seems to be an issue with the NextSequenceValue function.

Any suggestions are appreciated. So far I am unsuccessful but here is my code:

// This rule will create a new unique id when a road centerline is created // If the road was created from a split its original id will have a prefix of '::' // We will use this to find the original road and its related alias road names  if (Left($feature.CTRLINEID, 2) == "::" || IsEmpty($feature.CTRLINEID)) { var id = NextSequenceValue('CTRLINEID')      // If the centerlineid is not set return the new id if (IsEmpty($feature.CTRLINEID)) return id;   // Find the original ID of the road that was split     var original_id = Mid($feature.centerlineid, 2, Count($feature.centerlineid) - 2);     if (IsEmpty(original_id)) return id;      // Store an add for every road alias and related it to the new road that was added after the cut var newAttributes = {}; newAttributes['CTRLINEID'] = id }
0 Kudos
1 Reply
Esri Esteemed Contributor
0 Kudos