Select to view content in your preferred language

Use database sequence function from AGOL layer/table to generate unique integer IDs?

86
1
yesterday
Bud
by
Legendary Contributor

It’s possible to automatically populate the default value of an AGOL hosted feature layer GUID field using NEWID() WITH VALUES, using the Admin REST API.

https://community.esri.com/t5/arcgis-online-questions/add-guid-field-to-existing-agol-survey123-feat... 

Is there a way to do something similar, but instead of populating a GUID field, populate a sequential integer in a number field? (Or a textual ID with a prefix like SEWER-0000001 ?)

For example, is there a function similar to NEWID() that gets the next available integer for the layer/table from a database sequence?

An integer would be preferable over a GUID because it’s shorter and human-readable. All of our other asset IDs are integers or text-integer format, not GUIDs.

0 Kudos
1 Reply
Bud
by
Legendary Contributor

Would someone with DBA privileges in an on-prem Portal datastore database be able to poke around in a table to see if there are any database sequences used that would also be available in AGOL?

(This is more of an “out of curiosity” thing to see if we can learn anything interesting, not necessarily something that should be done in a mission-critical AGOL feature layer without testing.)

0 Kudos