Can I set a unique index on a field in a hosted feature layer

3566
14
Jump to solution
11-02-2017 02:11 PM
Trippetoe
Occasional Contributor III

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.

0 Kudos
14 Replies
Trippetoe
Occasional Contributor III

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

0 Kudos
ShanaGail1
Occasional Contributor

Ok, thanks Tom.  Maybe I'll start a new conversation on the topic if I don't find it being discussed elsewhere.

0 Kudos
by Anonymous User
Not applicable

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.

0 Kudos
Trippetoe
Occasional Contributor III

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

KennethBusby
Occasional Contributor

Does the constraint work with GeoForm? I am still able to create duplicate Case Numbers through GeoForm. 

0 Kudos