Select to view content in your preferred language

Attribute Rule to Create Unique ID Not Working

774
3
Jump to solution
04-03-2023 06:57 PM
MapMaven
New Contributor II

AttributeRules.jpgI am trying to create a feature class with attribute rules (ArcPro 2.9.2), where the next sequential number is added to the uniqueID field when a new feature is inserted. The Arcade expression appears to be correct, but the “Save” button is greyed out and I’m not able to test if the attribute rule works.  I first created a database sequence I named "MySeq" for the file geodatabase, with sequence start id = 1 and sequence increment value = 1.

Arcade Expression:

var id = NextSequenceValue ("MySeq");

return 'ID-${id}'

Any guidance would be greatly appreciated.

0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
MVP Frequent Contributor

Hmm, your images seem to be lost...

 

If you hover over the red square to the left of the attribute rule or over the greyed out save button, ArcGIS tells you what is wrong.


Have a great day!
Johannes

View solution in original post

0 Kudos
3 Replies
JohannesLindner
MVP Frequent Contributor

You use the wrong symbol for the template literal.

You're using single quotes, but it has to be backticks.

var id = NextSequenceValue ("MySeq");
return `ID-${id}`

// or just use this
//return "ID-" + id

Have a great day!
Johannes
MapMaven
New Contributor II
Hello,

Thank you for your help. I tried the suggested syntax, but the save button
is still greyed out.
I really don't understand what I'm doing wrong.

[image: image.png]



[image: image.png]
0 Kudos
JohannesLindner
MVP Frequent Contributor

Hmm, your images seem to be lost...

 

If you hover over the red square to the left of the attribute rule or over the greyed out save button, ArcGIS tells you what is wrong.


Have a great day!
Johannes
0 Kudos