How can I load field values into an array using arcade expression?

1549
3
11-10-2017 02:28 PM
EricPeña
Occasional Contributor

I am exploring Add Attribute Rule in ArcGIS Pro 2.1-beta.1.  I want to look at all values in an ID field, take the max value, and add 1. This way I can set up a rule that will always add the sequential number on INSERT.  How can I create an array of all existing values in an ID field? Is this possible with an arcade expression? 

3 Replies
DanielWebb
Occasional Contributor

Has this been answered anywhere?  I'm new to Arcade expressions.  Thanks!

0 Kudos
JoeBorgione
MVP Emeritus

Take a look at Create Database Sequence—Data Management toolbox | Documentation .  Sequences do the dirty work for you at the database level, all you do is create a simple attribute rule to use them at the feature class level.

That should just about do it....
OrrGvili
New Contributor III

this workd for me  

var features = FeatureSetByName($datastore,"polygons",["ID"],true)
var NewID = Max(features,"ID")+1
return NewID
0 Kudos