Select to view content in your preferred language

Error copying data into the feature service of a Survey123 Form

527
6
Jump to solution
06-09-2023 03:19 PM
BethanyCrenshaw1
New Contributor III

I often have the need to add additional data into the feature service that was collected outside of the app.  I get this error when I copy data into a feature service that has a Survey123 form.  When I paste or append data to the feature service using ArcGIS Pro, I get this error:

"General Function Failure: Error Code 1000.  The Insert Statement Conflicted with the foreign key constraint." 

Is there a way I can change the constraint?  Is there another workflow I should be using?

0 Kudos
1 Solution

Accepted Solutions
BethanyCrenshaw1
New Contributor III

I was able to copy old survey data into a new survey using the Update function on the Overview page of my hosted feature service in ArcGIS Online. 

In order to keep the relationships of the related tables that came from my survey repeats, I also needed to update the ParentGlobalID of those tables.  I did this manually in ArcGIS Pro.

Update_Tool.png

View solution in original post

0 Kudos
6 Replies
MobiusSnake
MVP

Are you adding data to a layer or table that has a related layer or table, specifically a "parent"?  This sounds like it could be an issue of trying to append a child record without a proper GUID pointing to a parent record.

0 Kudos
BethanyCrenshaw1
New Contributor III

Thank you MobiusSnake.  Yes, I am adding records to a table that is a child to the parent layer.   The data being added has the matching Parent GUID already in place in the tablet, so I thought that would be enough.  The fields all match too.  I wonder if it is related to being part of a Survey123 form, or something all hosted feature services have.

0 Kudos
ChristopherCounsell
MVP Regular Contributor
  • ArcGIS Online or ArcGIS Enterprise?
  • Hosted Feature Layer or referenced (ArcGIS Server)?
  • How was the service originally created? If Survey123 Connect, what version / when?
  • How was the additional data created? Where? Off what?

More information will help us narrow it down. Wildly guessing off the error message:

  • The relationship class of the external data you are trying to append does not match the target service
  • You are appending data with a related table to bring across the related records. The parent table data globalid already exists in the target service.
  • You are encountering some legacy bug from an earlier version? BUG-000117394
  • Your data is invalid i.e. globalid format not correct

 

BethanyCrenshaw1
New Contributor III

Thank you magisian for all your good suggestions.  That looks like my bug and others have encountered this.  I will check on some more things like the GlobalID format.    

The data is an ArcGIS Online Hosted Feature Layer.  It was created as part of a Survey123 form in Connect version 3.16 from an existing Feature Layer that contained the data.  The parent data are polygons (goshawk territories) and the child data are points (goshawk nests).  I want to copy/paste additional/updated nests using ArcGIS Pro.  The new nest data is all set up to match the feature service fields and has the correct Parent GlobalID.  I wonder if it's because it is because it is part of a Survey123 form.

ChristopherCounsell
MVP Regular Contributor

Can you examine the indexes for this table (specifically, any indexes that are present on the GlobalID field)? They should be unique but not ascending. If that is the case, this error indicates that a second record with the same GlobalID is being submitted - either that is a duplicate record or a GUID duplication occurred (which is theoretically possible but would be extremely, extremely, extremely unlikely).

https://community.esri.com/t5/arcgis-collector-questions/related-tables-for-offline-data-collection/...

From your other post I see it is the globalid field. Check the above, otherwise lodge a support ticket with esri if you haven't already. Mention the bug number and ask if there's any info on it or if it applies to you.

Something is suggesting that a globalid is being duplicated. It's difficult to identify why your service is impacted. Esri support likely to have the resources and time to screenshare to help out more with actively investigating your issue.

Otherwise maybe share the full information about how your service was created, and a video/screenshot of what you are doing exactly, so we can understand it. But like I mentioned it seems like this one needs some active digging. Sorry I can't be of more help.

0 Kudos
BethanyCrenshaw1
New Contributor III

I was able to copy old survey data into a new survey using the Update function on the Overview page of my hosted feature service in ArcGIS Online. 

In order to keep the relationships of the related tables that came from my survey repeats, I also needed to update the ParentGlobalID of those tables.  I did this manually in ArcGIS Pro.

Update_Tool.png

0 Kudos