question- how to Create hosted feature layer VIEW with references to original layer OBJECTIDs?

497
3
12-30-2020 10:39 AM
Labels (3)
AhnaMiller2
Occasional Contributor

I have two hosted feature layers that I am combining in a join as a hosted feature layer view Each table (table1 and table 2) have their own object IDs obviously

AhnaMiller2_5-1609353524245.png

 

AhnaMiller2_2-1609353041785.png

 

When I create a join between these two tables (based on global id/ parent global id), the resulting table does not keep the objectIDs from table 1 and table 2, though it does create a brand new OBJECTID that is not in anyway associated to the objectIDs in the other tables. I am wondering if there is a way to display the OBJECTIDs from Table1 and table 2 in this view so that we can reference the original table records when looking at this view? 

AhnaMiller2_4-1609353453346.png

 

 

 

 

3 Replies
curtvprice
MVP Esteemed Contributor

It is best to avoid OBJECTID as a key in joins for any datasets that persist for any length of time because this is a system maintained value that may be (and often is) modified by edits to the dataset, which includes format conversions and data copies that happen when publishing feature layers.  It is best practice to create non-objectid fields (which can be populated by copying the OBJECTID field to them) to use as join fields (keys) in your data model.

AhnaMiller2
Occasional Contributor

Thanks for your response! I am not exactly looking to join based on objectID. I've joined based on other fields. I am interested in simply displaying the OBJECTIDs of the original tables in the view

0 Kudos
AmandaRing
Esri Contributor

If you want to include the ObjectIDs, I would suggest creating a new field (integer type) within each table and then calculating the field based on the ObjectID value. In the Calculate Field dialog, you would calculate the new field using Table1ObjectID = OBJECTID

Hope that helps,
Amanda

0 Kudos