<?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: extract_changes returns empty updates in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-changes-returns-empty-updates/m-p/1253489#M8331</link>
    <description>&lt;P&gt;Hi&amp;nbsp; - Try entering the&amp;nbsp;&lt;EM&gt;servergen&lt;/EM&gt;&amp;nbsp;parameter like this instead of as a dictionary in a list:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;servergen = sg&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Jan 2023 18:52:23 GMT</pubDate>
    <dc:creator>JohnYaist1</dc:creator>
    <dc:date>2023-01-31T18:52:23Z</dc:date>
    <item>
      <title>extract_changes returns empty updates</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-changes-returns-empty-updates/m-p/1239675#M8141</link>
      <description>&lt;P&gt;I'm testing out the &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#featurelayercollection" target="_self"&gt;extract changes endpoint&lt;/A&gt; and I finally got it to work, but no matter what I do, the request returns always empty "updates".&lt;/P&gt;&lt;P&gt;I have tried editing a couple of features, either the shape or the table information, in map viewer. Then I save it. Then I make the call again, and the information is updated in "adds" object, but nothing in "updates". The&amp;nbsp;&lt;SPAN&gt;return_updates parameter is set to True.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Do I need to change the serverGen or something else? I don't get it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gis = GIS("URL", username, password)
item = gis.content.get("ID")
flc=FeatureLayerCollection(item.url, gis)
sg = flc.properties.changeTrackingInfo.layerServerGens[0].serverGen
req = flc.extract_changes(
    layers=[1],
    servergen=[{"id": 1, "serverGen": sg}],
    queries={1:{"where":"FID=1981"}},
    # return_ids_only=True,
    return_inserts=True,
    return_updates=True,
    data_format="json"
)
print(req)

# {'layerServerGens': 
#[{'id': 1, 'serverGen': 914376}], 'transportType': 'esriTransportTypeUrl', 'responseType': 'esriDataChangesResponseTypeEdits', 
#'edits':[{'id': 1, 'features': 
#{'adds': [{
#'geometry': {'paths': [[[-73.6592894210589, 45.505982917298], [-73.6583249229399, 45.5044803958229], [-73.6594751091767, 45.5029865662784], [-73.6604843118765, 45.5044454814924]]]}, 
#'attributes': {'FID': 1981, 'GlobalID': 'E096B38F-B18E-4322-BB4D-DBA25EE65BA0', 'id': 99999, 'terrain': '1', 'niveau_ms': 1, 'source': 'abc', 'CreationDate': 1670533735636, 'Creator': 'ME', 'EditDate': 1670601353246, 'Editor': 'ME', 'notes': 'updated feature', 'bb': 0}
#}], 
#'updates': [], 
#'deleteIds': []
#}}]}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2022 16:05:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-changes-returns-empty-updates/m-p/1239675#M8141</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2022-12-09T16:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: extract_changes returns empty updates</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-changes-returns-empty-updates/m-p/1253489#M8331</link>
      <description>&lt;P&gt;Hi&amp;nbsp; - Try entering the&amp;nbsp;&lt;EM&gt;servergen&lt;/EM&gt;&amp;nbsp;parameter like this instead of as a dictionary in a list:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;servergen = sg&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 18:52:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-changes-returns-empty-updates/m-p/1253489#M8331</guid>
      <dc:creator>JohnYaist1</dc:creator>
      <dc:date>2023-01-31T18:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: extract_changes returns empty updates</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-changes-returns-empty-updates/m-p/1254006#M8336</link>
      <description>&lt;P&gt;Thanks for your suggestion. Will be trying it out as soon as possible and update/accept as solution if that is the case.&lt;BR /&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 18:52:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-changes-returns-empty-updates/m-p/1254006#M8336</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2023-02-01T18:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: extract_changes returns empty updates</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-changes-returns-empty-updates/m-p/1257657#M8370</link>
      <description>&lt;P&gt;After some testing having the same issue where Updates always returns empty [], I realized that updates are currently showing together with the inserts.&lt;/P&gt;&lt;P&gt;Try doing this: returnInserts and ReturnDeletes = false and returnupdates = true.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The updated features should show in the Inserts list.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Maybe this is a bug. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Needs more investigation.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 18:58:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-changes-returns-empty-updates/m-p/1257657#M8370</guid>
      <dc:creator>jkersting</dc:creator>
      <dc:date>2023-02-13T18:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: extract_changes returns empty updates</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-changes-returns-empty-updates/m-p/1292769#M8734</link>
      <description>&lt;P&gt;Finally managed to put some time on this.&lt;/P&gt;&lt;P&gt;I don't know what I was doing wrong previously, possibly filtering (with "queries") on the wrong layer (1 instead of 0).&lt;/P&gt;&lt;P&gt;Anyway everything seems ok on my end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;gis = GIS("URL", username, password)
serviceId = "ID"
serviceItem = gis.content.get(serviceId)
flc = FeatureLayerCollection(serviceItem.url, gis)

sg = flc.properties.changeTrackingInfo.layerServerGens[0].serverGen

req = flc.extract_changes(
    layers=[0], # layer
    servergen=[{"id": 0, "serverGen": sg}],
    return_ids_only=True,
    return_inserts=True,
    return_updates=True,
    return_deletes=False
)

print(req)
# {'layerServerGens': [{'id': 0, 'serverGen': 1274270}], 'transportType': 'esriTransportTypeUrl', 'responseType': 'esriReplicaResponseTypeEdits', 'edits': [{'id': 0, 'objectIds': {'adds': [], 'updates': [1, 2, 4, 8], 'deletes': []}}]}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 19:45:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/extract-changes-returns-empty-updates/m-p/1292769#M8734</guid>
      <dc:creator>mikaël</dc:creator>
      <dc:date>2024-12-17T19:45:24Z</dc:date>
    </item>
  </channel>
</rss>

