Select to view content in your preferred language

Attribute Rules - Create Database Sequence

682
7
01-17-2024 01:33 PM
JHicklen
New Contributor II

Seeking a solution to update Database SequenceValue

 

Migrating from Attribute Assistant to Attribute Rules and I have several hundred legacy assets with AssetIDs

Ultimately, I'd like to Create a Database Sequence where the value will pick up from the last legacy asset AssetID.

 

Is there a way to modify the Database Sequence table?

Tags (1)
0 Kudos
7 Replies
Robert_LeClair
Esri Notable Contributor

This is not a specialty area for me but I did find an example of generating an ID by incrementing a sequence.  You can learn more about it here.

0 Kudos
BillFox
MVP Frequent Contributor

I'm not sure if that is supported in a versioned editing workflow

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

When you create a database sequence, you can specify the starting value. 

https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-database-sequence.htm

You could write a script that looped over those assets and got the max value.  Store that into an csv or excel and then script creating the seq with that value.

The sequences and attribute rule to leverage it is supported in a version environment, but if you use a seq in a version and delete that version, you do not get that value back, it is burnt.

We are looking into tools to assist Attribute Assistant customers create Attribute Rules easier, like the Generate ID, we are still in early development, but if you are interested in testing out the code as we build it, let us know.

0 Kudos
JHicklen
New Contributor II

Thanks, MikeMillerGIS

Good help

I specified the starting value in a sequence and created an arcade expression to customize the ID

I used AcrMap Attribute Assistant for years and years and of course the configurations were stored in a dynamic value table

I was wondering if Attribute Rules has a similar table view of the sequence

 

Also, ArcPro attribute rules has only two triggers: insert or update; how about on selection?

I’m seeking to update by selection; meaning: I have current data without Asset Ids, so I would like to select assets and generate unique IDs based on selection

Is my only option to copy the selected features into a data layer using update trigger to generate ID?

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

Trigger an update on them.  Depending on how you do your rule, that will trigger the update event on the rule and generate an ID if the field is null.

0 Kudos
JHicklen
New Contributor II

Thanks, I’m working on an expression rule to generate an ID if the field is null

0 Kudos
JHicklen
New Contributor II

Generating Unique IDs with Attribute Rules in ArcGIS Pro 3.2

My task is to generate Unique IDs for existing data within a feature class. (A legacy feature class within database that did not asset_ids populated)

Currently ArcPro Attribute Rules has two triggers (Insert or Update)

I’m seeking to execute a rule based on selection.

 

Steps to create custom id's:

Create database sequence

Create immediate or batch Attribute Rule

Arcade expression:

var id = NextSequenceValue("new_ID_seq")

return Text(id, 'STR-Test-0000')

 

Steps to create the id's on selected features:

Select the features first

Open attribute table and use field calculator on ASSETID field

Attribute Rule expression:

var id = NextSequenceValue("SEQUENCE")

return Text(id, 'STR-SIGN-0000')

 

Click ok to populate.

0 Kudos