<?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: Qt and Tables in a Feature Service in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/qt-and-tables-in-a-feature-service/m-p/751710#M3754</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you please email me a copy of your project? &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:ldanzinger@esri.com"&gt;ldanzinger@esri.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Luke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Apr 2015 22:14:19 GMT</pubDate>
    <dc:creator>LucasDanzinger</dc:creator>
    <dc:date>2015-04-16T22:14:19Z</dc:date>
    <item>
      <title>Qt and Tables in a Feature Service</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qt-and-tables-in-a-feature-service/m-p/751709#M3753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a feature service that is hosted on ArcGIS.com, and the service contains a feature layer and a plain table. I want to update an attribute in the table from my Qt application, but I cannot. I do catch the signal onApplyFeatureEditsStatusChanged() and the status is indeed Enums.ApplyEditsStatusErrored, but I don't understand how to handle the actual error object: applyFeatureEditsErrors. That is,&amp;nbsp; applyFeatureEditsErrors.error is undefined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The things that I CAN do:&lt;/P&gt;&lt;P&gt;- query the table, and loop through the results logging all the attribute values,&lt;/P&gt;&lt;P&gt;- update attributes in the table using the REST interface in a browser.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To check my code, I used the feature layer endpoint instead, created a feature layer from it, and added it to the map:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #ff8bff;"&gt;GeodatabaseFeatureServiceTable&lt;/SPAN&gt;&lt;SPAN style="color: #646482;"&gt; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #ff5555;"&gt;id&lt;/SPAN&gt;:&lt;SPAN style="color: #646482;"&gt; &lt;/SPAN&gt;myTableFromURL
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff5555;"&gt;url&lt;/SPAN&gt;:someFeatureServiceRESTEndpointURL

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #ff5555;"&gt;onApplyFeatureEditsStatusChanged&lt;/SPAN&gt;:&lt;SPAN style="color: #646482;"&gt; &lt;/SPAN&gt;{...}
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-style: italic;"&gt;featureLayer&lt;/SPAN&gt;.featureTable&lt;SPAN style="color: #646482;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #646482;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic;"&gt;myTableFromURL&lt;/SPAN&gt;;
&lt;SPAN style="font-style: italic;"&gt;appMap&lt;/SPAN&gt;.addLayer(&lt;SPAN style="font-style: italic;"&gt;featureLayer&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I waited for the FeatureLayer to initialize and verified that my table did too:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #646482;"&gt;&lt;SPAN style="color: #808bed;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="color: #646482;"&gt; &lt;/SPAN&gt;(&lt;SPAN style="font-style: italic;"&gt;myTableFromURL&lt;/SPAN&gt;.featureTableStatus&lt;SPAN style="color: #646482;"&gt; &lt;/SPAN&gt;===&lt;SPAN style="color: #646482;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff8bff;"&gt;Enums&lt;/SPAN&gt;.FeatureTableStatusInitialized)&lt;SPAN style="color: #646482;"&gt; &lt;/SPAN&gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic;"&gt;updatesEnabled&lt;/SPAN&gt;&lt;SPAN style="color: #646482;"&gt; &lt;/SPAN&gt;=&lt;SPAN style="color: #646482;"&gt; &lt;/SPAN&gt;true;
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can run a query to get features from the table/layer, and when the query is completed, loop through the records, updating data as I go:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;thisRecord.setAttributeValue("SOME_ATTRIBUTE","SOME_NEW_VALUE");
myTableFromURL.updateFeature(thisRecord.uniqueId,&lt;SPAN style="color: #646482;"&gt; &lt;/SPAN&gt;thisRecord);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And finally, once all the edits have been made to the features, tell the table to apply the changes:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-style: italic;"&gt;myTableFromURL&lt;/SPAN&gt;.applyFeatureEdits();&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The edits are visible in the feature layer on arcgis.com.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same process with the flat table (minus making and adding a feature layer to the map) does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a similar method to initialize a flat table (non-geo-enabled) as what happens when a feature layer is added to a map?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:55:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qt-and-tables-in-a-feature-service/m-p/751709#M3753</guid>
      <dc:creator>ChrisGoz</dc:creator>
      <dc:date>2021-12-12T07:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: Qt and Tables in a Feature Service</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qt-and-tables-in-a-feature-service/m-p/751710#M3754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you please email me a copy of your project? &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:ldanzinger@esri.com"&gt;ldanzinger@esri.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Luke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 22:14:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qt-and-tables-in-a-feature-service/m-p/751710#M3754</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2015-04-16T22:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Qt and Tables in a Feature Service</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/qt-and-tables-in-a-feature-service/m-p/751711#M3755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;There is indeed an issue with editing tables that are not feature layers at the current release of the Qt Runtime SDK.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #303030;"&gt;So for anyone interested, our solution was to add (fake point) geometry to the flat table so we could expose it as a feature layer in the REST service. Within the Qt code, I use the table and make it a (fake) feature layer that never gets added to the map. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; color: #303030; font-size: 10pt;"&gt;//initialize the fake feature layer from the table and initialize the layer&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; color: #303030; font-size: 10pt;"&gt;someTable.url = someRESTEndpointUrl;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; color: #303030; font-size: 10pt;"&gt;someTableFakeFeaturelayer.featureTable = userTable;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; color: #303030; font-size: 10pt;"&gt;someTableFakeFeaturelayer.initialize();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the feature layer’s status changes to LayerStatusInitialized, I run a query to get the data I want to update:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;if (someTable.featureTableStatus === Enums.FeatureTableStatusInitialized) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; //run a query to download the data we want from the service&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp; userQuery.where = aQueryString;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt; line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp; someTable.queryServiceFeatures(userQuery);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;And when the table’s QueryServiceFeaturesStatusChanged === QueryFeaturesStatusCompleted, I update the feature records that are returned and then finally apply the edits to the table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;var iterator_edits = queryServiceFeaturesResult.iterator;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;var thisRecord;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;while (iterator_edits.hasNext()) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //update some information&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; thisRecord = iterator_edits.next();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; thisRecord.setAttributeValue(m_NameOfAttribute, newValue);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //apply the edits to the feature (i.e., this data record)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateFeature(thisRecord.uniqueId, thisRecord);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;//apply the edits to the table&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;someTable.applyFeatureEdits();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And everything updates as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the insight on this Lucas!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2015 19:33:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/qt-and-tables-in-a-feature-service/m-p/751711#M3755</guid>
      <dc:creator>ChrisGoz</dc:creator>
      <dc:date>2015-04-22T19:33:09Z</dc:date>
    </item>
  </channel>
</rss>

