<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: &amp;quot;The INSERT statement conflicted with the FOREIGN KEY constraint&amp;quot; Error in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/quot-the-insert-statement-conflicted-with-the/m-p/1052015#M34193</link>
    <description>&lt;P&gt;Hello James,&lt;/P&gt;&lt;P&gt;I didn't want to start a new thread, since my issue is directly related to&amp;nbsp;&lt;SPAN&gt;BUG-000117394, and I wasn't sure where I might receive an answer first. I already commented on the thread, for which&amp;nbsp; you provided the link above, but I am going to outline my problem here as well. Any help is greatly appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I still struggle with&amp;nbsp;&lt;SPAN&gt;BUG-000117394&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;"The INSERT statement has conflicted with the FOREIGN KEY constraint" error (see attached screenshot).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I followed the following work flow:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Create survey form in Survey123 Connect, have a GUID field with esri field type GUID&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Publish the survey form&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Create an empty point, line, and polygon feature class in AGOL.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Download the survey feature class as well as the three other feature classes (point, line, polygon) and house in a geodatabase&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Make sure the point, line and polygon feature class has GlobalIDs and add unique Attribute indexes to it.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;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 &amp;amp; GUID fields with 1:M.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Upload the survey layer to AGOL - the three related feature layers get uploaded with it automatically.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Add the survey layer to an editable web map - the three related feature layers get added to the map automatically.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;edit the pop-up of all three feature layers (point, line, polygon) and insert the survey form link&amp;amp;field:GUID={GlobalID). The survey link that can be found in "Collaborate" on the Survey123 website for the respective survey.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Survey opens.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Fill out survey &amp;amp; submit - but then attached error message appears.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;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?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks a lot for the help.&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Send Error.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12005iB55EFF7857471CE1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Send Error.jpg" alt="Send Error.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Apr 2021 22:58:32 GMT</pubDate>
    <dc:creator>Taku_RiverTlingit</dc:creator>
    <dc:date>2021-04-27T22:58:32Z</dc:date>
    <item>
      <title>"The INSERT statement conflicted with the FOREIGN KEY constraint" Error</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/quot-the-insert-statement-conflicted-with-the/m-p/881815#M30785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;I am running the latest version of Connect (3.1.126) and the Survey123 Field app (&lt;SPAN style="background-color: #ffffff; border: 0px; font-weight: inherit;"&gt;3.1.158), but I&amp;nbsp;&lt;/SPAN&gt;am still running into&amp;nbsp;&lt;SPAN style="background-color: #ffffff; border: 0px; font-weight: inherit; text-decoration: underline;"&gt;BUG-000117394&lt;/SPAN&gt;. I am not sure why I am still receiving this error. I am passing the GlobalID from a feature service that has three different&amp;nbsp;parents layers&amp;nbsp;that are in a Collector map via a URL scheme to&amp;nbsp;a GUID field in&amp;nbsp;a related table that is related to all three of the&amp;nbsp;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.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;IMG __jive_id="432564" class="image-1 jive-image" height="479" src="https://community.esri.com/legacyfs/online/432564_pastedImage_2.png" style="border: 0px; font-weight: inherit; margin: 2px 20px 0px;" width="269" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Jan 2019 19:24:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/quot-the-insert-statement-conflicted-with-the/m-p/881815#M30785</guid>
      <dc:creator>deleted-user-i4sfC2RS1Ljp</dc:creator>
      <dc:date>2019-01-04T19:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: "The INSERT statement conflicted with the FOREIGN KEY constraint" Error</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/quot-the-insert-statement-conflicted-with-the/m-p/881816#M30786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've followed up to a comment version of this question in&amp;nbsp;&lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/groups/survey123/blog/2018/11/02/st-kilda-penguin-release-31?commentID=68739#comment-69012" title="https://community.esri.com/groups/survey123/blog/2018/11/02/st-kilda-penguin-release-31?commentID=68739#comment-69012"&gt;https://community.esri.com/groups/survey123/blog/2018/11/02/st-kilda-penguin-release-31?commentID=68739#comment-69012&lt;/A&gt;&amp;nbsp;. &amp;nbsp;This looks to be an issue with the index on the GlobalID field of the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 21:50:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/quot-the-insert-statement-conflicted-with-the/m-p/881816#M30786</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2019-01-11T21:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: "The INSERT statement conflicted with the FOREIGN KEY constraint" Error</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/quot-the-insert-statement-conflicted-with-the/m-p/1052015#M34193</link>
      <description>&lt;P&gt;Hello James,&lt;/P&gt;&lt;P&gt;I didn't want to start a new thread, since my issue is directly related to&amp;nbsp;&lt;SPAN&gt;BUG-000117394, and I wasn't sure where I might receive an answer first. I already commented on the thread, for which&amp;nbsp; you provided the link above, but I am going to outline my problem here as well. Any help is greatly appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I still struggle with&amp;nbsp;&lt;SPAN&gt;BUG-000117394&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;"The INSERT statement has conflicted with the FOREIGN KEY constraint" error (see attached screenshot).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I followed the following work flow:&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Create survey form in Survey123 Connect, have a GUID field with esri field type GUID&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Publish the survey form&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Create an empty point, line, and polygon feature class in AGOL.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Download the survey feature class as well as the three other feature classes (point, line, polygon) and house in a geodatabase&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Make sure the point, line and polygon feature class has GlobalIDs and add unique Attribute indexes to it.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;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 &amp;amp; GUID fields with 1:M.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Upload the survey layer to AGOL - the three related feature layers get uploaded with it automatically.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Add the survey layer to an editable web map - the three related feature layers get added to the map automatically.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;edit the pop-up of all three feature layers (point, line, polygon) and insert the survey form link&amp;amp;field:GUID={GlobalID). The survey link that can be found in "Collaborate" on the Survey123 website for the respective survey.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Survey opens.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Fill out survey &amp;amp; submit - but then attached error message appears.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;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?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks a lot for the help.&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Send Error.jpg" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/12005iB55EFF7857471CE1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Send Error.jpg" alt="Send Error.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 22:58:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/quot-the-insert-statement-conflicted-with-the/m-p/1052015#M34193</guid>
      <dc:creator>Taku_RiverTlingit</dc:creator>
      <dc:date>2021-04-27T22:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: "The INSERT statement conflicted with the FOREIGN KEY constraint" Error</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/quot-the-insert-statement-conflicted-with-the/m-p/1283304#M48912</link>
      <description>&lt;P&gt;I just started getting this same error myself...&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 13:03:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/quot-the-insert-statement-conflicted-with-the/m-p/1283304#M48912</guid>
      <dc:creator>ArmstKP</dc:creator>
      <dc:date>2023-04-27T13:03:44Z</dc:date>
    </item>
  </channel>
</rss>

