Appending Survey123 data and maintaining relationships

519
4
07-20-2020 09:47 AM
BradleyManning1
New Contributor II

Hello,

I recently had to make changes to a survey I built that had a lot of begin repeats (various pieces of related equipment). I made schema changes to the survey which caused the survey to lose any submitted data to that point. Before publishing I downloaded the submitted surveys as a file gdb. I then published the new survey schema, but I needed to append the survey data I downloaded back in to the feature service. 

I followed the steps here: How To: Append data to a Survey123 for ArcGIS survey from an existing survey with related tables to append the surveys back in, however I lost all of the relationships the survey originally had. So now, all of the data is appended in to the tables again, however, they are not related in anyway. I assume because when I appended them in, a new Global ID, or something along those lines.

Is there a way to append downloaded surveys back in to the surveys feature service, and maintain those relationships?

I am currently on version 3.9.120

Thanks,

Brad

0 Kudos
4 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Bradley,

One thing that can be done at the publishing step is to choose to use another GUID field instead of globalID as the parent relationship field - this would allow the relationship to persist across a change as you describe.

Using ArcGIS Pro, it is possible to maintain existing GlobalIDs using the Append Geoprocessing tool

Aside from the above, as part of the migration process, you can add an additional GUID field while the data is in a geodatabase to store the existing globalID; that field also needs to exist in the feature class.  After the data is loaded, you can create a lookup table between new globalID and existing globalID and update the destination fields with the new values (this is probably best done 

BradleyManning1
New Contributor II

Thanks James, this makes sense. I was at the point where I was trying not to republish. This survey is for some interns we currently have and their time is limited. What I ended up doing was going to the items detail page and on the data tab, I simply copy and pasted the new parent global ID for each record that was missing the relationship. Not ideal, but it worked and I didn't have to republish and risk losing anything.

0 Kudos
ZacharySutherby
Esri Regular Contributor

Hello Bradley, 

On top of what James said here are a few additional resources that may help out: 

https://community.esri.com/thread/213108-loading-survey13-data-with-related-tables-into-a-new-form#c... 

https://www.youtube.com/watch?v=S5V6MIrAKCk&t=1s

I will be updating that How To article to include the ArcGIS Pro workflow. 

Thank you, 

Zach 

Thank you,
Zach
DougBrowning
MVP Notable Contributor

Also this post may help  https://community.esri.com/thread/202815-preserving-a-globalid-while-moving-data-between-feature-cla...

The other option to to change to a different key that you can reproduce.  I do not use globalids for keys for all the reasons in this post https://community.esri.com/thread/166958

Hope that helps