<?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 updateFeature not for geometry position? in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/updatefeature-not-for-geometry-position/m-p/810561#M1587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i'd like to change the given position of a selected Feature to my GPS position. For testing i also changed some attribute values. After the update i can see the changes on my map until i restart the app but only the changes to the attributes are persistent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to replace the existing geometry with an new created from my GPS postion.&lt;/P&gt;&lt;P&gt;My second try was to use the setXY function of the geometry object with the projected GPS coordinates.&lt;/P&gt;&lt;P&gt;Both ways work on the screen/app but not the data behind (feature layer in arcgis online). Only the attribut values are updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Button{
&amp;nbsp; text: "Update"
&amp;nbsp; onClicked: {
&amp;nbsp;&amp;nbsp;&amp;nbsp; featureToEdit = featureLayer.featureTable.feature(hitFeatureId)
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (featureToEdit) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var saveX = featureToEdit.geometry.x.toFixed(3)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureToEdit.geometry = posGPS.project(featureToEdit.geometry.spatialReference)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var newX = featureToEdit.geometry.x.toFixed(3)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureToEdit.setAttributeValue("description",("old: " + saveX + "; new: " + newX))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureServiceTable.updateFeature(hitFeatureId, featureToEdit);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureServiceTable.applyFeatureEdits();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My workaround is to delete the original feature and place a copy on the new position.&lt;/P&gt;&lt;P&gt;Poor performance solution on refreshing the map to show the features again. (Only panning the map helps to redraw the features)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe anyone can tell me how to update the position in the right way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards, Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 09:30:42 GMT</pubDate>
    <dc:creator>TestAppStudio</dc:creator>
    <dc:date>2021-12-12T09:30:42Z</dc:date>
    <item>
      <title>updateFeature not for geometry position?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/updatefeature-not-for-geometry-position/m-p/810561#M1587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i'd like to change the given position of a selected Feature to my GPS position. For testing i also changed some attribute values. After the update i can see the changes on my map until i restart the app but only the changes to the attributes are persistent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to replace the existing geometry with an new created from my GPS postion.&lt;/P&gt;&lt;P&gt;My second try was to use the setXY function of the geometry object with the projected GPS coordinates.&lt;/P&gt;&lt;P&gt;Both ways work on the screen/app but not the data behind (feature layer in arcgis online). Only the attribut values are updated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Button{
&amp;nbsp; text: "Update"
&amp;nbsp; onClicked: {
&amp;nbsp;&amp;nbsp;&amp;nbsp; featureToEdit = featureLayer.featureTable.feature(hitFeatureId)
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (featureToEdit) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var saveX = featureToEdit.geometry.x.toFixed(3)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureToEdit.geometry = posGPS.project(featureToEdit.geometry.spatialReference)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var newX = featureToEdit.geometry.x.toFixed(3)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureToEdit.setAttributeValue("description",("old: " + saveX + "; new: " + newX))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureServiceTable.updateFeature(hitFeatureId, featureToEdit);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureServiceTable.applyFeatureEdits();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My workaround is to delete the original feature and place a copy on the new position.&lt;/P&gt;&lt;P&gt;Poor performance solution on refreshing the map to show the features again. (Only panning the map helps to redraw the features)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe anyone can tell me how to update the position in the right way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards, Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:30:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/updatefeature-not-for-geometry-position/m-p/810561#M1587</guid>
      <dc:creator>TestAppStudio</dc:creator>
      <dc:date>2021-12-12T09:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: updateFeature not for geometry position?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/updatefeature-not-for-geometry-position/m-p/810562#M1588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Christian&lt;/P&gt;&lt;P&gt;I remember having the same issue back around Sep last year when AppStudio still in Beta and discussed it with ESRI but I'm not sure if they ever resolved it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For me, I found that the updateFeature didn't update the geometry if I was trying to use a GeodatabaseFeatureServiceTable. However, the app I was building at the time used offline geodatabases, and the updateFeature method worked fine for a GeodatabaseFeatureTable, so I never followed it up any further myself at the time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Drop me a line at &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:paul@gpsit.co.nz"&gt;paul@gpsit.co.nz&lt;/A&gt;&lt;SPAN&gt; if you like and I can forward you an email from back then outlining what I tested and who I spoke with if you think it would help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;-Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2016 15:08:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/updatefeature-not-for-geometry-position/m-p/810562#M1588</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-05-25T15:08:06Z</dc:date>
    </item>
  </channel>
</rss>

