Search on objectid

2016
7
05-25-2017 12:05 PM
randyhorner
New Contributor II

I want to use Locate to search on objectid (or any other way someone can suggest).  When I go to configure the layer for Locate, the objectid field is not listed.  Any suggestions would be appreciated.

7 Replies
Robert_LeClair
Esri Frequent Contributor

Randy - it would seem that all ArcGIS maintained fields for the Configure Layer for Locate options are missing.  You could add a new field to your feature class attribute table and calculate the new field by the ObjectID.  Then you could configure the Locate to search on that field.

0 Kudos
randyhorner
New Contributor II

Thanks for the reply Robert.   Find myself regularly searching on objectid when digging into people's data issues, so having a search available for objectid is handy.  I'll use your suggestion for now but hope they add it later as adding a field to all feature classes to do an objectid search would be a little cumbersome, especially since the objectid is already there. Thanks again for your quick response.  Look forward to continuing to learn Pro.

ThomasColson
MVP Frequent Contributor

So every time the OID is updated (say, add a new feature), you'd have to perform this calculation again. I'm with Randy, sometimes, especially when looking at data issues (e.g. failed edits, etc...), objectid is the only thing you have to go on. 

mfcallahan
Occasional Contributor

I think it is generally considered bad practice to treat the objectid field as a unique primary or foreign key when querying tables, as the objectid column may not persist and/or the values may be updated when transforming the data in various GP tools. 

More info from GIS Stack Exchange: When is it safe to use ObjectIDs as keys in a relationship class?

0 Kudos
ThomasColson
MVP Frequent Contributor

I don't think this issue is related to using the OID in relationship classes. 

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Although I agree with your statement overall, I don't think it is applicable here.  The fact is that Esri has put meaning to the FID/OID/OBJECTID field.  When troubleshooting certain kinds of data issues, especially as they pertain to errors generated from Esri geoprocessing tools, using OID to track down a record is both handy and relevant.

ChaimSchwartz4
Occasional Contributor

Searching for the objectID is certainly required at times for me too - within the webapp builder you can configure the search widget to search for the objectID field.

0 Kudos