<?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: Automatecally update data in ArcGis when I update the excel sheet? in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1036243#M38930</link>
    <description>&lt;P&gt;Thank you for your help&lt;/P&gt;</description>
    <pubDate>Sat, 13 Mar 2021 11:29:25 GMT</pubDate>
    <dc:creator>CharfeldineMahammedi</dc:creator>
    <dc:date>2021-03-13T11:29:25Z</dc:date>
    <item>
      <title>Automatecally update data in ArcGis when I update the excel sheet?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1033766#M38822</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;SPAN&gt;I am wondering if there is any option to automatecally update data in ArcGis when I update the excel sheet?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Your help is appreciated. Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Mar 2021 16:19:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1033766#M38822</guid>
      <dc:creator>CharfeldineMahammedi</dc:creator>
      <dc:date>2021-03-07T16:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Automatecally update data in ArcGis when I update the excel sheet?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1033767#M38823</link>
      <description>&lt;P&gt;If you can link the feature class to the excel table/spreadsheet by a common field (e.g. the spreadsheet values referencing a matching ObjectID in the feature class), a Join might be a good option.&amp;nbsp;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/add-join.htm" target="_blank" rel="noopener"&gt;Add Join (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;edit - not an AGOL solution&lt;/P&gt;</description>
      <pubDate>Sun, 07 Mar 2021 18:46:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1033767#M38823</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2021-03-07T18:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Automatecally update data in ArcGis when I update the excel sheet?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1033779#M38824</link>
      <description>&lt;P&gt;I'm assuming you mean in a hosted web layer? If that's the case, there's no way to do it "automatically", but there are ways to make it easier.&lt;/P&gt;&lt;H4&gt;Published Standalone File&lt;/H4&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1615141171171.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7762i4EC5366370094399/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1615141171171.png" alt="jcarlson_0-1615141171171.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If your layer is published from a standalone excel file, as in the image above, you can choose to &lt;A href="https://doc.arcgis.com/en/arcgis-online/manage-data/manage-hosted-feature-layers.htm#APPEND" target="_self"&gt;&lt;STRONG&gt;Append&lt;/STRONG&gt; &lt;/A&gt;to the layer by re-uploading the same file. You can also overwrite the entire file, but if your source data has a unique identifier field, the Append option can be used to maintain existing features.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_1-1615141325039.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7763i77D478E7C6B33EC8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_1-1615141325039.png" alt="jcarlson_1-1615141325039.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_2-1615141404113.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7764i372A7A812216D18C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_2-1615141404113.png" alt="jcarlson_2-1615141404113.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;H4&gt;Slightly Easier Alternative: Cloud Drive&lt;/H4&gt;&lt;P&gt;If you have the option, consider &lt;A href="https://doc.arcgis.com/en/arcgis-online/manage-data/add-items.htm#ADDITEM_CLOUD" target="_self"&gt;adding your data from a cloud drive&lt;/A&gt;, such as Google Drive or Microsoft OneDrive. The adding process works the same as when adding from a standalone layer. The key difference here is that the update process just looks for that same file in your cloud drive, and you don't have to maintain an offline copy.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_3-1615141717150.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/7766iA53C53BBFDE0BE35/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_3-1615141717150.png" alt="jcarlson_3-1615141717150.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This method is great if you're collaborating with other users on the data, or want to take advantage of the built-in versioning and sharing options of the cloud drive of your choice.&lt;/P&gt;&lt;H4&gt;The "Automatically" Part&lt;/H4&gt;&lt;P&gt;Finally, whichever option you choose, you &lt;EM&gt;can&lt;/EM&gt; use the &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#arcgis.features.FeatureLayer.append" target="_self"&gt;Python API&lt;/A&gt; to schedule a script which runs the append or overwrite function at regular intervals, thus making the hosted layer as close to a "live" copy of the Excel sheet as is feasible.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Mar 2021 18:31:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1033779#M38824</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-03-07T18:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Automatecally update data in ArcGis when I update the excel sheet?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1036243#M38930</link>
      <description>&lt;P&gt;Thank you for your help&lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 11:29:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1036243#M38930</guid>
      <dc:creator>CharfeldineMahammedi</dc:creator>
      <dc:date>2021-03-13T11:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Automatecally update data in ArcGis when I update the excel sheet?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1036245#M38931</link>
      <description>&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 11:32:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1036245#M38931</guid>
      <dc:creator>CharfeldineMahammedi</dc:creator>
      <dc:date>2021-03-13T11:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Automatecally update data in ArcGis when I update the excel sheet?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1358800#M56337</link>
      <description>&lt;P&gt;You can delete existing features from a hosted feature layer and append new features with Python. The example below creates a json from a shapefile which is loaded via edit_features with the adds parameter. The Excel file can probably be subbed for the shapefile. Finally this script can be scheduled as a task to run at the needed frequency.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# import libraries
import os
import sys

import arcgis
import arcpy
from arcgis.gis import GIS

from base import get_logger

arcpy.env.overwriteOutput = True

# Set up logger file
logger = get_logger("z_arl_data_v4", "a")
logger.info("Preparing JSON for AGOL")

# Set variables
ws = "E:/batch/arl/content/"
loc = ws
pth = os.chdir(loc)
output_feature_class = "ARL_data.shp"
localJSON = ws + "./arl_content.json"

try:
    if os.path.isfile(localJSON):
        os.remove(localJSON)

except FileNotFoundError:
    print("Wrong file or file path")

# Truncate the existing feature layer

def TruncateWebLayer(gis, target):

    try:
        lyr = arcgis.features.FeatureLayer(target, gis)
        lyr.manager.truncate()
        print("Successfully truncated layer: " + str(target))
    except Exception:
        e = sys.exc_info()[1]
        print(e.args[0])

# LAPD log in, create a profile so you don't need to show un/pw
mygis = GIS("https://site.maps.arcgis.com/", profile="python_playground_prof")

# publishedWebLayer is the URL of a single feature layer within a collection in
# an AGOL portal
publishedWebLayer = "https://services6.arcgis.com/alphanumericpath/arcgis/rest/services/ARL_data/FeatureServer/0"

# a feature class on the local system with the same schema as the
# portal layer
updateFeatures = os.path.join("E:/batch/arl/content/" + output_feature_class)

# remove all features from the already published feature layer
feature_layer_item = mygis.content.search("arl whole file")[0]
flayers = feature_layer_item.layers

flayer = flayers[0]

flayer.delete_features(where="area &amp;gt; 0 OR area =0")
logger.info("Deleting existing features from AGOL")

# reference the empty layer as FeatureLayer object from the ArcGIS Python API
fl = arcgis.features.FeatureLayer(publishedWebLayer, mygis)

# create a JSON object from the local features
jSON = arcpy.FeaturesToJSON_conversion(updateFeatures, localJSON)

# create a FeatureSet object from the JSON

fs = arcgis.features.FeatureSet.from_json(open(localJSON).read())
# logstuff("Creating a featureset from the JSON")

# add/append the local features to the hosted feature layer

fl.edit_features(adds=fs)
# logstuff("Appending latest data to the hosted feature layer")
logger.info(arcpy.GetMessages(1))

logger.info("Finishing steps for load to AGOL")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 22:42:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/automatecally-update-data-in-arcgis-when-i-update/m-p/1358800#M56337</guid>
      <dc:creator>ellipsol</dc:creator>
      <dc:date>2023-12-08T22:42:40Z</dc:date>
    </item>
  </channel>
</rss>

