I have a 'case number' field in our hosted feature layer that serves as a human-readable unique identifier. I need to prevent duplicate values being entered in that field (our current process is to run a query nightly to identify any duplicate entries).
Is there a way to set a unique index on that field? Or any other ways to guarantee uniqueness of values as the values are being entered?
In a sort of worst case, is there a way to query the hosted feature layer before the new record (or edited record) is submitted? If the value exists, the user could be notified.
Thank you.
Solved! Go to Solution.
Hey Shana.
Alas, I have not yet found a way to create a 'performance' index on an attribute field in AGOL (doesn't mean there isnt one though ). Let me know if you do find a way. I was feeling lucky just to get a unique index.
I wonder if an index you created on the local feature layer (before posting to AGOL) would be respected when you published to AGOL or not. I suspect not....
Good luck,
Tom
Ok, thanks Tom. Maybe I'll start a new conversation on the topic if I don't find it being discussed elsewhere.
Hello! Did you ever figure out how to create an idex on a field for a feature layer hosted in AGOL? I am having a similar performance issues for a layer that has 250K+ records. Performance is so slow sometimes. Would love to index certain fields we are querying on to speed it up.
As an update on this thread, Esri recently added the ability to add a Unique Index on a field for a hosted feature layer. See the help document here: Manage hosted feature layers—ArcGIS Online Help | ArcGIS
Search for the section header Add a unique constraint to a field
Does the constraint work with GeoForm? I am still able to create duplicate Case Numbers through GeoForm.