<?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 Add Feature for Table Returns success, Add Result when returned for relationship doesn't in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/add-feature-for-table-returns-success-add-result/m-p/1495105#M13232</link>
    <description>&lt;P&gt;So I have a bit of a puzzling behavior.&lt;BR /&gt;&lt;BR /&gt;We have been working on a custom widget that allows us to collect data from a form, and then add it to a table in AGOL.&amp;nbsp; &amp;nbsp; The edit is conducted via apply edits sending the new feature with 'add-feature' as part of the data sent.&lt;BR /&gt;&lt;BR /&gt;When it returns it returns as expected and that table entry now appears:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TimWestern_0-1718830690546.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107465i11EFF24C4D8D4448/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TimWestern_0-1718830690546.png" alt="TimWestern_0-1718830690546.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;TimWestern_0-1718830690546.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;This table also has a relationship with the ID Field used for the parcel, so I have to make sure the relationship is created in code.&amp;nbsp; &amp;nbsp;I use a similar service call (just different feature data going to the relationship and it returns:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TimWestern_1-1718830745017.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107466iB989D68DFB797FBD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TimWestern_1-1718830745017.png" alt="TimWestern_1-1718830745017.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;TimWestern_1-1718830745017.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;At first I thought it must have worked because I got a globalID back, but it doesn't include success= true and error is returned = null.&amp;nbsp; Does this mean the add failed? Or is it possible I've done something else wrong?&lt;BR /&gt;&lt;BR /&gt;The table and relationship are in the same service (and are also in a map that uses the service inside of it in case that matters).&lt;BR /&gt;&lt;BR /&gt;Any thoughts?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2024 21:00:55 GMT</pubDate>
    <dc:creator>TimWestern</dc:creator>
    <dc:date>2024-06-19T21:00:55Z</dc:date>
    <item>
      <title>Add Feature for Table Returns success, Add Result when returned for relationship doesn't</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/add-feature-for-table-returns-success-add-result/m-p/1495105#M13232</link>
      <description>&lt;P&gt;So I have a bit of a puzzling behavior.&lt;BR /&gt;&lt;BR /&gt;We have been working on a custom widget that allows us to collect data from a form, and then add it to a table in AGOL.&amp;nbsp; &amp;nbsp; The edit is conducted via apply edits sending the new feature with 'add-feature' as part of the data sent.&lt;BR /&gt;&lt;BR /&gt;When it returns it returns as expected and that table entry now appears:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TimWestern_0-1718830690546.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107465i11EFF24C4D8D4448/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TimWestern_0-1718830690546.png" alt="TimWestern_0-1718830690546.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;TimWestern_0-1718830690546.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;This table also has a relationship with the ID Field used for the parcel, so I have to make sure the relationship is created in code.&amp;nbsp; &amp;nbsp;I use a similar service call (just different feature data going to the relationship and it returns:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TimWestern_1-1718830745017.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107466iB989D68DFB797FBD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TimWestern_1-1718830745017.png" alt="TimWestern_1-1718830745017.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;TimWestern_1-1718830745017.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;At first I thought it must have worked because I got a globalID back, but it doesn't include success= true and error is returned = null.&amp;nbsp; Does this mean the add failed? Or is it possible I've done something else wrong?&lt;BR /&gt;&lt;BR /&gt;The table and relationship are in the same service (and are also in a map that uses the service inside of it in case that matters).&lt;BR /&gt;&lt;BR /&gt;Any thoughts?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 21:00:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/add-feature-for-table-returns-success-add-result/m-p/1495105#M13232</guid>
      <dc:creator>TimWestern</dc:creator>
      <dc:date>2024-06-19T21:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Add Feature for Table Returns success, Add Result when returned for relationship doesn't</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/add-feature-for-table-returns-success-add-result/m-p/1498230#M13345</link>
      <description>&lt;P&gt;I can confirm that I have found a solution.&amp;nbsp; There were a number of issues in my code which I won't share here, but if your relationship 'table' has addFeature and applyEdits you should be able to write to them as you would any other table or layer.&amp;nbsp; This was not clear from&amp;nbsp; the documentation, and so i wondered if it was possible, but it turned out I had a bit of a context problem in my code.&lt;BR /&gt;&lt;BR /&gt;If you get the Feature ID (the number in the path) for the first layer/table, and want to write to the other one, you gotta make sure that you identify, 1 the correct layer/table and its index when you try to write its expected data.&amp;nbsp; SOmehow I was passing the first layerIndex in error, and didn't catch it because in a generic sense it looked correct, (but it wasn't correct), once I added that relationshipLayerId, it wrote out no problems!&lt;BR /&gt;&lt;BR /&gt;This may sound like obvious advice, but when you get into many-to-many m-2-m relationships, you may end up with three layer/table identifiers and its very easy to miss pass one of the ids.&amp;nbsp; So save yourself many hours of effort and name your methods that call into other labels with a different more clear index parameter name so its easier to catch in the future.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 13:03:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/add-feature-for-table-returns-success-add-result/m-p/1498230#M13345</guid>
      <dc:creator>TimWestern</dc:creator>
      <dc:date>2024-06-27T13:03:54Z</dc:date>
    </item>
  </channel>
</rss>

