<?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 Returning new records hourly from hosted feature layer in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/returning-new-records-hourly-from-hosted-feature/m-p/803627#M2167</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working a script&amp;nbsp;that should pull down only the most recently created records (from within the past hour) from a hosted feature layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scenario/workflow:&lt;/P&gt;&lt;P&gt;(1) Customer creates a new record to the feature layer via a Survey123 submission&lt;/P&gt;&lt;P&gt;(2) Script runs hourly to export any new records and pulls this record down to save to a local SQL Server DB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have been able to do so far:&lt;/P&gt;&lt;P&gt;(1) Get item content and export all features to a CSV via a ZIP folder to the local machine&lt;/P&gt;&lt;P&gt;(2) Unzip the folder, remove the CSV Collection from AGOL and delete the ZIP folder locally, leaving the local CSV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;However, this is where I start to have the problem.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I will manually modify the feature layer (add in a polygon), allow the feature layer to save, verify in the feature layer properties that it recognizes the modification, and then run the script, but the modification isn't recognized.&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-4" src="https://community.esri.com/legacyfs/online/441009_pastedImage_5.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure if it's because I live in the Central time zone and the&amp;nbsp;&lt;EM&gt;then_ts&lt;/EM&gt; variable is simply converting Central time to UTC while&amp;nbsp;&lt;EM&gt;uwfBuildings&lt;/EM&gt; is strictly UTC or what, but it's doing my head in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the&amp;nbsp;&lt;EM&gt;seconds&lt;/EM&gt; variable for&amp;nbsp;&lt;EM&gt;then&lt;/EM&gt; to (3600*4) - for four hours ago - it will recognize that a change has been made, even though the change I made last was 30 min ago:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/441008_pastedImage_4.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm concerned that it is not possible to get the time resolution for the last modification for a feature layer to within an hour. If there is, &lt;STRONG&gt;how&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Also, concerning the export method&lt;/STRONG&gt;, even if I get this to work, how can I pull specific records from the feature layer that match the criteria? What&amp;nbsp;&lt;EM&gt;WHERE&lt;/EM&gt; clause could be used to identify new records if the feature layer isn't time-enabled (see below - the &lt;EM&gt;WHERE&lt;/EM&gt; clause would go after the&amp;nbsp;&lt;EM&gt;export_format&lt;/EM&gt; parameter)?&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/440986_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for any and all help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Apr 2019 19:28:46 GMT</pubDate>
    <dc:creator>JeremyMullins1</dc:creator>
    <dc:date>2019-04-02T19:28:46Z</dc:date>
    <item>
      <title>Returning new records hourly from hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/returning-new-records-hourly-from-hosted-feature/m-p/803627#M2167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm working a script&amp;nbsp;that should pull down only the most recently created records (from within the past hour) from a hosted feature layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scenario/workflow:&lt;/P&gt;&lt;P&gt;(1) Customer creates a new record to the feature layer via a Survey123 submission&lt;/P&gt;&lt;P&gt;(2) Script runs hourly to export any new records and pulls this record down to save to a local SQL Server DB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have been able to do so far:&lt;/P&gt;&lt;P&gt;(1) Get item content and export all features to a CSV via a ZIP folder to the local machine&lt;/P&gt;&lt;P&gt;(2) Unzip the folder, remove the CSV Collection from AGOL and delete the ZIP folder locally, leaving the local CSV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;However, this is where I start to have the problem.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I will manually modify the feature layer (add in a polygon), allow the feature layer to save, verify in the feature layer properties that it recognizes the modification, and then run the script, but the modification isn't recognized.&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-4" src="https://community.esri.com/legacyfs/online/441009_pastedImage_5.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure if it's because I live in the Central time zone and the&amp;nbsp;&lt;EM&gt;then_ts&lt;/EM&gt; variable is simply converting Central time to UTC while&amp;nbsp;&lt;EM&gt;uwfBuildings&lt;/EM&gt; is strictly UTC or what, but it's doing my head in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I change the&amp;nbsp;&lt;EM&gt;seconds&lt;/EM&gt; variable for&amp;nbsp;&lt;EM&gt;then&lt;/EM&gt; to (3600*4) - for four hours ago - it will recognize that a change has been made, even though the change I made last was 30 min ago:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/441008_pastedImage_4.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm concerned that it is not possible to get the time resolution for the last modification for a feature layer to within an hour. If there is, &lt;STRONG&gt;how&lt;/STRONG&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Also, concerning the export method&lt;/STRONG&gt;, even if I get this to work, how can I pull specific records from the feature layer that match the criteria? What&amp;nbsp;&lt;EM&gt;WHERE&lt;/EM&gt; clause could be used to identify new records if the feature layer isn't time-enabled (see below - the &lt;EM&gt;WHERE&lt;/EM&gt; clause would go after the&amp;nbsp;&lt;EM&gt;export_format&lt;/EM&gt; parameter)?&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/440986_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;Thanks so much for any and all help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2019 19:28:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/returning-new-records-hourly-from-hosted-feature/m-p/803627#M2167</guid>
      <dc:creator>JeremyMullins1</dc:creator>
      <dc:date>2019-04-02T19:28:46Z</dc:date>
    </item>
  </channel>
</rss>

