Appending hosted feature layers with repeats

704
4
Jump to solution
09-30-2019 10:53 AM
K_Rocks
New Contributor III

Hi,

I'm hoping for some advice on the best procedure for appending related feature layers in a AGOL feature service.

We have a hosted feature service on AGOL updating from a Survey123 form. It includes a Survey point feature layer and several repeats, 4 of which are point feature layers with potential attachments and related to that parent Survey layer (through parentGlobalID). There is also a table, again with repeats related to the Survey point. This feature service is currently live.

There are two older iterations of the feature service, each with the same basic structure of the Survey layer and the several repeats layers with attachments. The parent Survey feature layers in these have slightly different schemas from the current one, with a small number of fields having being added/removed/renamed in the iterations. These feature services are no longer live.

We wish to append the two older feature services to the current feature service, maintaining the relationships for each repeat and attachments to the parent survey. Bearing in mind the Append tool only allows one target dataset at a time, and therefore feature service-to-feature service is not possible, what is the best procedure to carry this out? If I append the Survey layers first, will the repeats then relate as expected?

I tried to test this with local file geodatabase copies but found that ticking "Preserve Global IDs" in the Append tool resulted in a 999999 error. With this unticked the append did work, but surely that would result in the relationships being broken as the GlobalID-parentGlobalID relationships need to be maintained? I'm wary of testing it on the current live layer.

Thanks for any help.

0 Kudos
1 Solution

Accepted Solutions
K_Rocks
New Contributor III

Hi Peter,

Yes, I ran through my scenario with the local Esri guys and making GlobalID = Guid type is the way to do it. In order not to be tampering with live feature services, I downloaded all 3 feature services to file geodatabases, appended the relevant tables one by one (as you suggest above), and then uploaded this as a new feature service to AGOL.

All worked out fine.

Thanks.

View solution in original post

4 Replies
LeighDurland
New Contributor III

any luck with this? also looking for this process. 

0 Kudos
K_Rocks
New Contributor III

I haven't heard anything yet on this, Leigh, but did come across this blog thread which suggests specifying the Type of the resulting GlobalID and ParentGlobalID fields as "Guid" rather than "GlobalID" when setting up the Append tool. Doing this appears to allow the old IDs to be maintained with an Append process in a file geodatabase at least (I had made a copy to try it rather than work with a live feature layer).

As there happens to be no additional data coming in for that particular project over the next few months, I might try this Append procedure directly on the layers in the AGOL feature service after I've backed them up. However, it would be of some comfort if it could be confirmed that this is the correct approach.

0 Kudos
Peter_Klingman
Esri Regular Contributor

Hi K. Rocks‌ & Leigh Durland‌,

You will need to append the tables one-by-one as well.

This is a common issue due to the uniqueness of GlobalIDs. I recorded a quick demo of a workflow that can get around this issue: How To: Preserve GlobalID/GUID Relationships when Appending Records - YouTube 

Your data setup is more complicated than the video demo, but hopefully this gives an idea of where to begin. 

Best regards,

-Peter

0 Kudos
K_Rocks
New Contributor III

Hi Peter,

Yes, I ran through my scenario with the local Esri guys and making GlobalID = Guid type is the way to do it. In order not to be tampering with live feature services, I downloaded all 3 feature services to file geodatabases, appended the relevant tables one by one (as you suggest above), and then uploaded this as a new feature service to AGOL.

All worked out fine.

Thanks.