Select to view content in your preferred language

Hosted Feature Layer View Does Not Update When Overwriting Hosted Feature Layer

4544
13
01-04-2023 07:47 AM
AmandaBeck
Regular Contributor

I just used the Overwrite Web Layer in ArcGIS Pro to update a Hosted Feature Layer in ArcGIS Online. That Hosted Feature Layer updated successfully, however, the Hosted Feature Layer View that we have in a lot of ArcGIS Online maps/apps did not update. An error message pops up saying that the layer is not available anymore.

I did this successfully back in September 2022, but it is not working right now. Does anybody know what may be happening here? Did ESRI change this capability? Any comments are appreciated.

Thanks! 

0 Kudos
13 Replies
RhettZufelt
MVP Notable Contributor

I agree, thanks for the code.  Seems to work well if I don't have any attachments and will get a lot of mileage out of it.

I see you can add add/update/delete attachments with this, but from what I can tell one must supply a dictionary listing all the attachements to add.

Do you know of a simple way to have this "maintain" the attachments of the features being added without somehow having to come up with the dictionary?

Thanks,

R_

0 Kudos
jcarlson
MVP Esteemed Contributor

Are the attachments coming from the source dataset, or are you trying to maintain things that have been attached to the destination?

I don't have an "overwrite" process that involves layers with attachments, but I do have a few layers with attachments that get updated from an external source. It's a different process, using the pandas module's compare method to identify edited rows between source and destination, then updating those features in place.

More complex to set up, but say you have a 50k feature layer and only 1000 actually get edited in the source, this would only edit those 1000 in the destination, leaving the other 49k untouched entirely. It's equivalent to just opening the attribute table and making edits, albeit much, much faster.

If you're interested, I presented on the topic at a conference last year, and you can find all the notes and Python code here: https://github.com/jdcarls2/ilgisa-2022/blob/main/hosted-copy/hosted-copy.ipynb

- Josh Carlson
Kendall County GIS
0 Kudos
RhettZufelt
MVP Notable Contributor

Looking for a way to "Overwrite" my hosted layer with local (SDE) data.

The data is a combination of local data and hosted data, but I bring them all together in a local feature class, edit/modify, etc.

Then, I want to overwrite the hosted feature layer with the "new" data.  If I don't make any schema changes, ensure layer id's dont change, etc. "most" of the time, I can overwrite the HFL with Pro, and it works just fine.  However, as we all know, now and then, it will 'break' pretty much everything that is tied to it, and it all needs to be re-configured.

Trying to avoid this, and have had good success with truncating the HFL data and appending the SDE data to it.  This works well, even maintains the attachments.  HOWEVER, the Preserve Global IDs does NOT work with HFL.  Documentation says it's a "known limitation" which past experience tells me that most likely ESRI does not plan on changing this.

Basically, trying to figure out a way to 'replace' a HFL's data without breaking any maps/popups/apps/etc. that are using it, but, need to maintain the attachments and the Global ID's, but am not able to figure out a tool/method that does both.

Interesting that I can go from HFL to SDE/MGDB with no issues, but can't go the other way. 

Kind of defeats the purpose of a unique global id if it is changing on you......

Thanks again for any insight,

R_

0 Kudos
JTessier
Frequent Contributor

We are doing the same thing as @RhettZufelt , and get some interesting issues, have lots of retries built in to get it to work.  Will ping colleagues to post some help as we figure things out.

0 Kudos