Select to view content in your preferred language

ArcGIS Online: Cannot set custom ObjectID values when inserting via FME

131
3
Monday
NicoTuijp
New Contributor

I'm migrating from ArcGIS Enterprise to ArcGIS Online and encountering an issue with ObjectID field control during data synchronization.

Problem: When inserting data from an FME workspace into ArcGIS Online feature layer, I cannot control the ObjectID values. The system automatically assigns sequential ObjectID values instead of using my own Identifier values from my source database.

Context:

  • Source: Database with specific ID values that need to be preserved
  • Target: ArcGIS Online feature layer
  • Tool: FME workspace for synchronization
  • Previous setup: This worked correctly in ArcGIS Enterprise environment as the DB was directly connected.
  • Field type: esriFieldTypeOID

Is it possible to create ArcGIS Online feature layers where ObjectID fields can accept custom values during insert operations? If not, what are the recommended alternatives to maintain the required ID relationship between source data and feature layer records?

What I've tried:

I attempted to modify the layer definition to make the ObjectID field editable:

"fields": [
  {
    "name": "id",
    "type": "esriFieldTypeOID",
    "alias": "id",
    "editable": true,
    ...
  }
]

However, after saving, the editable property automatically reverts to false..

I tried some other stuff, but seems to be the same.

0 Kudos
3 Replies
RyanUthoff
MVP Regular Contributor

The ObjectID field is typically controlled by Esri and the end user typically doesn't have any control over it, especially in an ArcGIS Online context. You do have some limited control over it when exporting data to FGDB's (like being able to maintain the ObjectID when exporting), and you might be able to specify the ObjectID directly in SQL (which typically isn't recommended). But that doesn't really help with AGOL. That is all controlled by Esri and I'm not aware of any way to preserve the ObjectID when uploading records to AGOL.

I'm just taking a shot in the dark here, but you might be able to export your dataset to a FGDB (use the Copy tool which preserves ObjectID). Then upload that FGDB to AGOL and publish a feature service from it. It's possible it might maintain the ObjectID using that workflow, but it's not something I've personally tried. Because it seems like you're trying to add records to an already existing feature layer, which you probably won't be able to manage the ObjectIDs. But if you create a new feature layer from your FGDB, it's possible AGOL will preserve the ObjectIDs depending on how AGOL is creating that feature layer.

Edit: I just tested the workflow and I have confirmed that it does maintain the ObjectID (in my very limited test).

0 Kudos
NicoTuijp
New Contributor

Thanks for your answer. 

The copy tool you mention. That is directly in an Arcgis tool? 

I read the Postgis DB through a FME reader. Then write it directly to FGDB with "Esri Geodatabase (File Geodb Open API)" writer.
I can now explicity set the id to have type objectid, but it still seems to go to 1 at first creation.
I uploaded some screens.

Any tips or additions?

0 Kudos
RyanUthoff
MVP Regular Contributor

Yep, the Copy tool is just a tool in ArcGIS Pro.

I don't believe FME will be able to preserve the ObjectIDs, at least not in the ObjectID column when you write it to a FGDB. The ObjectID column is still managed by Esri in that case, and not FME. And FME typically can't override Esri.

I think the only way to preserve the ObjectID in the actual ObjectID column is to do it completely through Esri using the Copy tool.

0 Kudos