<?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 Using a python notebook to append features to a different layer for &amp;quot;storage&amp;quot;/backup in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-a-python-notebook-to-append-features-to-a/m-p/1665888#M74902</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am currently trying to use python to essentially backup features from a "Tracking" layer to a hosted feature layer (I'm gonna call this layer the "repository layer") for extra storage. Originally I was using a notebook to create a spatial data frame of the tracking layer, compare it against the global ids in the repository layer, and append those features if those global ids aren't in there.&lt;/P&gt;&lt;P&gt;My current issue is that as of a few months ago, my script stopped working. After some troubleshooting I realized that the issue lies in trying to load my entire layer into a spatial dataframe. This worked previously, but now it only lets me load up to 180 features, if I try any more than that, it gives me a JSON Decode Error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sophered_0-1763136473116.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/143785iB34D5EED4A693D4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sophered_0-1763136473116.png" alt="sophered_0-1763136473116.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is what my troubleshooting currently looks like. I'm wondering if there is a way to get around this, if i should avoid dataframes entirely and if&amp;nbsp;I should try an entirely different approach. I was testing around with Returning IDs Only in my query and trying to use those ids to have a similar functionality, but I don't even know where to start with that. Any help would be GREATLY appreciated!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Nov 2025 16:11:27 GMT</pubDate>
    <dc:creator>sophered</dc:creator>
    <dc:date>2025-11-14T16:11:27Z</dc:date>
    <item>
      <title>Using a python notebook to append features to a different layer for "storage"/backup</title>
      <link>https://community.esri.com/t5/python-questions/using-a-python-notebook-to-append-features-to-a/m-p/1665888#M74902</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am currently trying to use python to essentially backup features from a "Tracking" layer to a hosted feature layer (I'm gonna call this layer the "repository layer") for extra storage. Originally I was using a notebook to create a spatial data frame of the tracking layer, compare it against the global ids in the repository layer, and append those features if those global ids aren't in there.&lt;/P&gt;&lt;P&gt;My current issue is that as of a few months ago, my script stopped working. After some troubleshooting I realized that the issue lies in trying to load my entire layer into a spatial dataframe. This worked previously, but now it only lets me load up to 180 features, if I try any more than that, it gives me a JSON Decode Error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sophered_0-1763136473116.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/143785iB34D5EED4A693D4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sophered_0-1763136473116.png" alt="sophered_0-1763136473116.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is what my troubleshooting currently looks like. I'm wondering if there is a way to get around this, if i should avoid dataframes entirely and if&amp;nbsp;I should try an entirely different approach. I was testing around with Returning IDs Only in my query and trying to use those ids to have a similar functionality, but I don't even know where to start with that. Any help would be GREATLY appreciated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 16:11:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-python-notebook-to-append-features-to-a/m-p/1665888#M74902</guid>
      <dc:creator>sophered</dc:creator>
      <dc:date>2025-11-14T16:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using a python notebook to append features to a different layer for "storage"/backup</title>
      <link>https://community.esri.com/t5/python-questions/using-a-python-notebook-to-append-features-to-a/m-p/1665917#M74903</link>
      <description>&lt;P&gt;If your tracking layer has dates or date/times on the samples, you could use those to select the features created since last backup. You can create a text file in your notebook's files folder and record the last backup date there when it runs.&lt;/P&gt;&lt;P&gt;Another way to handle it is to add a "processed" or "Done" field to your tracking layer, with a default value (I do this with Survey123 feature services). I use integers, to make the expression simple, and calculate their new value to some different value after they're processed up (say 0 and 1). Then each time the script runs, select the features that have the default value and copy them to the back up layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Get the survey results layer and call the FeatureLayer
item = gis.content.get("2522222e41111111116f75448222")
surveyResults = item.layers[0]


FS = surveyResults.query(where='Done = 0')
print("Number of new surveys: " + str(len(FS)))
newResponses = FS.features
#
# do something with the features
#
#
# Now that the new records have been processed, update the Done field so they won't be read next time.

for surveyResponse in newResponses:
    AGOedit = surveyResponse
    AGOedit.attributes['Done'] = '1'
    updateResult = surveyResults.edit_features(updates=[AGOedit])

&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 17:26:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-a-python-notebook-to-append-features-to-a/m-p/1665917#M74903</guid>
      <dc:creator>BobBooth1</dc:creator>
      <dc:date>2025-11-14T17:26:10Z</dc:date>
    </item>
  </channel>
</rss>

