"The INSERT statement conflicted with the FOREIGN KEY constraint" Error

2290
3
01-04-2019 11:24 AM
deleted-user-i4sfC2RS1Ljp
New Contributor

I am running the latest version of Connect (3.1.126) and the Survey123 Field app (3.1.158), but I am still running into BUG-000117394. I am not sure why I am still receiving this error. I am passing the GlobalID from a feature service that has three different parents layers that are in a Collector map via a URL scheme to a GUID field in a related table that is related to all three of the layers. I am able to pass the GlobalID successfully to the Survey but when I submit my survey I receive the follow error, "The INSERT statement conflicted with the FOREIGN KEY constraint." I am not sure if I am missing something. thanks for the help.

 

3 Replies
JamesTedrick
Esri Esteemed Contributor

Hi,

I've followed up to a comment version of this question in https://community.esri.com/groups/survey123/blog/2018/11/02/st-kilda-penguin-release-31?commentID=68... .  This looks to be an issue with the index on the GlobalID field of the table.

0 Kudos
Taku_RiverTlingit
New Contributor III

Hello James,

I didn't want to start a new thread, since my issue is directly related to BUG-000117394, and I wasn't sure where I might receive an answer first. I already commented on the thread, for which  you provided the link above, but I am going to outline my problem here as well. Any help is greatly appreciated 🙂 


I still struggle with BUG-000117394 "The INSERT statement has conflicted with the FOREIGN KEY constraint" error (see attached screenshot).

I followed the following work flow:

  1. Create survey form in Survey123 Connect, have a GUID field with esri field type GUID
  2. Publish the survey form
  3. Create an empty point, line, and polygon feature class in AGOL.
  4. Download the survey feature class as well as the three other feature classes (point, line, polygon) and house in a geodatabase
  5. Make sure the point, line and polygon feature class has GlobalIDs and add unique Attribute indexes to it.
  6. Create three relationship classes between survey layer and each of the three other layers, where the point, line and polygon layer is the origin table, and the survey layer is the destination table based on GlobalID & GUID fields with 1:M.
  7. Upload the survey layer to AGOL - the three related feature layers get uploaded with it automatically.
  8. Add the survey layer to an editable web map - the three related feature layers get added to the map automatically.
  9. edit the pop-up of all three feature layers (point, line, polygon) and insert the survey form link&field:GUID={GlobalID). The survey link that can be found in "Collaborate" on the Survey123 website for the respective survey.
  10. Test the whole thing using ArcGIS Collector - I am accessing said web map, create a feature, e.g., using the point feature layer. Once feature is created, click on it to show pop-up, then click on survey link.
  11. Survey opens.
  12. Fill out survey & submit - but then attached error message appears.

 

I initially created the survey using Survey123 3.9, but I re-published using the latest version. Any ideas what I am doing wrong? One thing I am not entirely sure about is: I might have added the attribute index to the GlobalDs AFTER creating the relationship classes. would that matter at all?

Thanks a lot for the help.Send Error.jpg

0 Kudos
ArmstKP
Occasional Contributor III

I just started getting this same error myself...

0 Kudos