<?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 Bug? ArcGIS REST API service layer operation extractChanges returns adds as updates in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/bug-arcgis-rest-api-service-layer-operation/m-p/204218#M997</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been playing with a python tool to sync our local featureclasses with their corresponding service layers.&amp;nbsp;The whole thing kind of hinges on the extractChanges operation and services' ChangeTracking capability working as advertised. By and large, it works great.&amp;nbsp;There seems to be a catch (read: bug), though: &lt;STRONG&gt;new features that were created or&amp;nbsp;edited in&amp;nbsp;AGOL web viewer are returned as updates instead of adds.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think&amp;nbsp;this bug might point to a fundamental difference in the way that the AGOL web viewer handles editing compared to Collector. In the web viewer, every single edit operation is treated like an update; there's no "save changes" button because every single change is streamed to the service as it happens. In Collector, all the changes made during editing / creation are pushed to the service all at once when you tap the submit button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This means that, in the AGOL web viewer, at the moment you create a new feature the dateCreated and dateLastUpdate fields are identical.&amp;nbsp;If you enter even a single attribute, the dateLastUpdate field is changed. By contrast, in Collector, new features are pushed to AGOL fully formed; Collector doesn't stream individual attribute updates, it only uploads adds/updates to AGOL when you tap the submit button, then sends it all at once.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I kinda suspect that the&amp;nbsp;extractChanges operations&amp;nbsp;populates the adds by querying the layer for features&amp;nbsp;where&amp;nbsp;dateCreated == dateLastUpdate (or something to that effect). Because of this difference in behavior between AGOL / Collector, new features created in Collector are correctly returned as adds and new features created in AGOL are returned as updates. Furthermore, if a new feature-- originally created in Collector-- is edited in the AGOL web viewer, it's returned as an update.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Feature creation / editing in ArcPro works the same way as AGOL web viewer, apparently. Syncing a replica from ArcMap works like Collector. Go figure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I've submitted a bug report with steps to replicate this. I would love for someone to please tell I'm wrong and that I've overlooking something glaring. Or maybe, ESRI, you should implement a save changes button for the feature creation/editing popup in AGOL web viewer a la Collector and populate adds with a&amp;nbsp;query that doesn't suck.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Oct 2020 18:47:03 GMT</pubDate>
    <dc:creator>NickNuebel</dc:creator>
    <dc:date>2020-10-12T18:47:03Z</dc:date>
    <item>
      <title>Bug? ArcGIS REST API service layer operation extractChanges returns adds as updates</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/bug-arcgis-rest-api-service-layer-operation/m-p/204218#M997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been playing with a python tool to sync our local featureclasses with their corresponding service layers.&amp;nbsp;The whole thing kind of hinges on the extractChanges operation and services' ChangeTracking capability working as advertised. By and large, it works great.&amp;nbsp;There seems to be a catch (read: bug), though: &lt;STRONG&gt;new features that were created or&amp;nbsp;edited in&amp;nbsp;AGOL web viewer are returned as updates instead of adds.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think&amp;nbsp;this bug might point to a fundamental difference in the way that the AGOL web viewer handles editing compared to Collector. In the web viewer, every single edit operation is treated like an update; there's no "save changes" button because every single change is streamed to the service as it happens. In Collector, all the changes made during editing / creation are pushed to the service all at once when you tap the submit button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This means that, in the AGOL web viewer, at the moment you create a new feature the dateCreated and dateLastUpdate fields are identical.&amp;nbsp;If you enter even a single attribute, the dateLastUpdate field is changed. By contrast, in Collector, new features are pushed to AGOL fully formed; Collector doesn't stream individual attribute updates, it only uploads adds/updates to AGOL when you tap the submit button, then sends it all at once.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I kinda suspect that the&amp;nbsp;extractChanges operations&amp;nbsp;populates the adds by querying the layer for features&amp;nbsp;where&amp;nbsp;dateCreated == dateLastUpdate (or something to that effect). Because of this difference in behavior between AGOL / Collector, new features created in Collector are correctly returned as adds and new features created in AGOL are returned as updates. Furthermore, if a new feature-- originally created in Collector-- is edited in the AGOL web viewer, it's returned as an update.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Feature creation / editing in ArcPro works the same way as AGOL web viewer, apparently. Syncing a replica from ArcMap works like Collector. Go figure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I've submitted a bug report with steps to replicate this. I would love for someone to please tell I'm wrong and that I've overlooking something glaring. Or maybe, ESRI, you should implement a save changes button for the feature creation/editing popup in AGOL web viewer a la Collector and populate adds with a&amp;nbsp;query that doesn't suck.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2020 18:47:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/bug-arcgis-rest-api-service-layer-operation/m-p/204218#M997</guid>
      <dc:creator>NickNuebel</dc:creator>
      <dc:date>2020-10-12T18:47:03Z</dc:date>
    </item>
  </channel>
</rss>

