<?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: How can I determine uniqueId of main feature using webhook response? in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850229#M23230</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see now how to manually look up the&amp;nbsp;&lt;STRONG&gt;form_id&lt;/STRONG&gt;. Is it possible to programmatically&amp;nbsp;look up the&amp;nbsp;&lt;STRONG&gt;form_id&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Aug 2018 20:40:04 GMT</pubDate>
    <dc:creator>MattStayner</dc:creator>
    <dc:date>2018-08-08T20:40:04Z</dc:date>
    <item>
      <title>How can I determine uniqueId of main feature using webhook response?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850225#M23226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is an easy task if you don't have repeats. When you introduce repeats, you get multiple&amp;nbsp;&lt;STRONG&gt;addResults&lt;/STRONG&gt;&amp;nbsp;that each have an attribute of &lt;STRONG&gt;uniqueId&lt;/STRONG&gt;&amp;nbsp;(see attached &lt;STRONG&gt;responseMult.py&lt;/STRONG&gt;) and it is not easy to tell which one belongs to the main layer and which ones belong to related tables. In the case of the attached results, the uniqueId is 3. It is different if there are no repeats (see attached &lt;STRONG&gt;responseSingle.py&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What logic can I use to write code that gets the correct &lt;STRONG&gt;uniqueId&lt;/STRONG&gt;&amp;nbsp;every time? Below are&amp;nbsp;3 approaches I'm considering.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Approach 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Use the &lt;STRONG&gt;addResults&lt;/STRONG&gt;&amp;nbsp;with &lt;STRONG&gt;id: 0&lt;/STRONG&gt;. That is the case in the 2 attached examples. Is that &lt;STRONG&gt;&lt;EM&gt;always&lt;/EM&gt;&lt;/STRONG&gt; true? Does &lt;STRONG&gt;id: 0&lt;/STRONG&gt; always reference the main layer and subsequent ids represent related tables? If that is &lt;EM&gt;&lt;STRONG&gt;always&lt;/STRONG&gt;&lt;/EM&gt; the case, then that is pretty simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Approach 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If there is only 1&amp;nbsp;&lt;STRONG&gt;addResults&amp;nbsp;&lt;/STRONG&gt;then use the&amp;nbsp;&lt;STRONG&gt;uniqueId&lt;/STRONG&gt; of that&amp;nbsp;&lt;STRONG&gt;addResults&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If there is more than 1&amp;nbsp;&lt;STRONG&gt;addResults,&lt;/STRONG&gt; then look up the&amp;nbsp;&lt;STRONG&gt;parentglobalid&amp;nbsp;&lt;/STRONG&gt;in the &lt;STRONG&gt;adds&lt;/STRONG&gt; and use that to lookup the &lt;STRONG&gt;globalId&lt;/STRONG&gt;&amp;nbsp;of the correct &lt;STRONG&gt;addResults&lt;/STRONG&gt;. This is a little complicated, but should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Approach 3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Use&amp;nbsp;&lt;STRONG&gt;layerInfo&lt;/STRONG&gt; to get the &lt;STRONG&gt;id&lt;/STRONG&gt; of the correct&amp;nbsp;&lt;STRONG&gt;addResults&lt;/STRONG&gt;. I have results from a webhook from a while ago that included&amp;nbsp;&lt;STRONG&gt;layerInfo&lt;/STRONG&gt; attributes, which included, among other things, the&amp;nbsp;&lt;STRONG&gt;id&lt;/STRONG&gt; of the layer. For some reason that is not included in the webhook responses, we get now. Any thoughts on why? It seems like this would be the best approach&amp;nbsp;if we could be could get it turned back on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 22:18:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850225#M23226</guid>
      <dc:creator>MattStayner</dc:creator>
      <dc:date>2018-08-06T22:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I determine uniqueId of main feature using webhook response?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850226#M23227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The parent record will be the addResults with the id (layer id) that matches the layer set by form_id. Default will be 0 for Surveys published through Survey123; it differs if you go through the steps of configuring a survey to use an existing feature service and modify the form_id to point to a different layer than 0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2018 22:31:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850226#M23227</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2018-08-06T22:31:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I determine uniqueId of main feature using webhook response?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850227#M23228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it sounds like I need to access the form definition and look up the&amp;nbsp;&lt;STRONG&gt;form_id&lt;/STRONG&gt;, then I will know with&amp;nbsp;&lt;STRONG&gt;addResult&lt;/STRONG&gt; to use. How can I programmatically&amp;nbsp;look up the&amp;nbsp;&lt;STRONG&gt;form_id&lt;/STRONG&gt; in the form definition? I see&amp;nbsp;&lt;STRONG&gt;form_id&lt;/STRONG&gt; on the&amp;nbsp;&lt;STRONG&gt;settings&lt;/STRONG&gt; tab in the&amp;nbsp;&lt;STRONG&gt;Connect&lt;/STRONG&gt; Excel spreadsheet. It is blank on the few surveys that I created. Does a blank value mean the&amp;nbsp;&lt;STRONG&gt;id&lt;/STRONG&gt; is 0?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 18:28:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850227#M23228</guid>
      <dc:creator>MattStayner</dc:creator>
      <dc:date>2018-08-08T18:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I determine uniqueId of main feature using webhook response?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850228#M23229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Matt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, if blank it's the default state, which is layer 0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 19:30:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850228#M23229</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2018-08-08T19:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: How can I determine uniqueId of main feature using webhook response?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850229#M23230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see now how to manually look up the&amp;nbsp;&lt;STRONG&gt;form_id&lt;/STRONG&gt;. Is it possible to programmatically&amp;nbsp;look up the&amp;nbsp;&lt;STRONG&gt;form_id&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 20:40:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850229#M23230</guid>
      <dc:creator>MattStayner</dc:creator>
      <dc:date>2018-08-08T20:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I determine uniqueId of main feature using webhook response?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850230#M23231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right now, it would be a bit complicated - you could get the XForm XML file and read it from there. &amp;nbsp;I've added an enhancement to the webhook payload to provide the parent layer's ID.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 21:06:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850230#M23231</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2018-08-08T21:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I determine uniqueId of main feature using webhook response?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850231#M23232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would be&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;great&lt;/STRONG&gt;&lt;/EM&gt; if the layer ID could be provided in the webhook payload. For now, we will just look it up manually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick responses!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2018 21:32:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-can-i-determine-uniqueid-of-main-feature-using/m-p/850231#M23232</guid>
      <dc:creator>MattStayner</dc:creator>
      <dc:date>2018-08-08T21:32:20Z</dc:date>
    </item>
  </channel>
</rss>

