<?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: Adding a record to a related table? in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/adding-a-record-to-a-related-table/m-p/839302#M2510</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, Related Table is also a Feature Layer. Hence editing, adding or updating records in the Related Table is no different from editing,adding or updating a normal Feature Layer. Please use the same approach to add records as shown in Add &amp;amp; Delete features minus the geometry ( as I suspect your Related Table may not have any geometry associated).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Few steps here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// You will be using the ServiceFeatureTable.createFeature( &amp;lt;pass the attributes&amp;gt;) to create the Feature where&amp;nbsp;&lt;SPAN&gt;ServiceFeatureTable will be your related Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;// Then you&amp;nbsp;&lt;SPAN style="color: #6a737d; background-color: #ffffff;"&gt;relate new feature to origin feature using feature.relateFeature()&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #6a737d;"&gt;// Finally, add new feature to related table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #6a737d;"&gt;// Finally, perform&amp;nbsp;applyEdits()&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Jul 2018 20:08:38 GMT</pubDate>
    <dc:creator>nakulmanocha</dc:creator>
    <dc:date>2018-07-31T20:08:38Z</dc:date>
    <item>
      <title>Adding a record to a related table?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/adding-a-record-to-a-related-table/m-p/839301#M2509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible through QML to add a record to a related table?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My example is I have a table with a bunch of assets located in a Water Treatment Plant.&amp;nbsp; I created&amp;nbsp; a related table in Arc Catalog and have it published as a feature service(along with my assets).&amp;nbsp; I want be able to query a record(using the barcode scanner) and add a record to the related table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for I have the barcode side of things set up but I'm only finding information on querying a related table not adding to a related table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2018 18:13:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/adding-a-record-to-a-related-table/m-p/839301#M2509</guid>
      <dc:creator>KyleSchultz1</dc:creator>
      <dc:date>2018-07-31T18:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a record to a related table?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/adding-a-record-to-a-related-table/m-p/839302#M2510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, Related Table is also a Feature Layer. Hence editing, adding or updating records in the Related Table is no different from editing,adding or updating a normal Feature Layer. Please use the same approach to add records as shown in Add &amp;amp; Delete features minus the geometry ( as I suspect your Related Table may not have any geometry associated).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Few steps here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// You will be using the ServiceFeatureTable.createFeature( &amp;lt;pass the attributes&amp;gt;) to create the Feature where&amp;nbsp;&lt;SPAN&gt;ServiceFeatureTable will be your related Table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;// Then you&amp;nbsp;&lt;SPAN style="color: #6a737d; background-color: #ffffff;"&gt;relate new feature to origin feature using feature.relateFeature()&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #6a737d;"&gt;// Finally, add new feature to related table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #6a737d;"&gt;// Finally, perform&amp;nbsp;applyEdits()&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2018 20:08:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/adding-a-record-to-a-related-table/m-p/839302#M2510</guid>
      <dc:creator>nakulmanocha</dc:creator>
      <dc:date>2018-07-31T20:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a record to a related table?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/adding-a-record-to-a-related-table/m-p/839303#M2511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I removed my original comment because after some work I got&amp;nbsp; a lot further now than I was&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's coming back with the record in the related table.&amp;nbsp; But my attributes I'm sending across are returning null&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #c0c0c0;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2985c7;"&gt;featureAttributes&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;{&lt;SPAN style="color: #008000;"&gt;"barcode"&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;:&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;"0000-TEST"&lt;/SPAN&gt;,&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;"asset"&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;:&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;"test"&lt;/SPAN&gt;};&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="color: #c0c0c0;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2985c7;"&gt;featureNew&lt;/SPAN&gt;&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #c0c0c0;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;relateTable&lt;/SPAN&gt;.createFeature(&lt;SPAN style="color: #2985c7;"&gt;featureAttributes&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="color: #c0c0c0;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #2985c7;"&gt;features&lt;/SPAN&gt;[0].relateFeature(&lt;SPAN style="color: #2985c7;"&gt;featureNew&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="color: #c0c0c0;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;relateTable&lt;/SPAN&gt;.addFeature(&lt;SPAN style="color: #2985c7;"&gt;featureNew&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="color: #c0c0c0;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;relateTable.applyEdits();&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2018 13:23:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/adding-a-record-to-a-related-table/m-p/839303#M2511</guid>
      <dc:creator>KyleSchultz1</dc:creator>
      <dc:date>2018-08-01T13:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a record to a related table?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/adding-a-record-to-a-related-table/m-p/839304#M2512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you ever get this to work?&amp;nbsp; I am stuck on this exact thing?&amp;nbsp; I have a related notes table to my parent Feature Layer.&amp;nbsp; The table represents various notes taken on the parent Feature layer.&amp;nbsp; Every time I try and create a blank feature it comes back as null?&amp;nbsp; Do the createFeatureAttributes all have to be accounted for or something, meaning that we need GlobalID too?&amp;nbsp; In my below code my noteFeature is always null after the createFeature line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;notefeatureAttributes = {"1" : 1, 2 : 2};
var notesTable = app.fieldNoteTable; //&lt;SPAN&gt;QmlServiceFeatureTable&lt;/SPAN&gt;
var noteFeature = notesTable.createFeature(notefeatureAttributes); //NULL Featrue?&lt;/PRE&gt;&lt;P&gt;My noteFeature above is null after that line&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:59:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/adding-a-record-to-a-related-table/m-p/839304#M2512</guid>
      <dc:creator>MKa</dc:creator>
      <dc:date>2021-12-12T16:59:18Z</dc:date>
    </item>
  </channel>
</rss>

