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

11-10-2017 02:28 PM
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
New Contributor III

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

0 Kudos
MVP Esteemed Contributor

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.

can't wait to retire....
New Contributor II

this workd for me  

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