<?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 Python script to change data source of feature layer in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/python-script-to-change-data-source-of-feature/m-p/1342391#M55363</link>
    <description>&lt;P&gt;I am trying to write a script that updates a feature layer on arcgis online. I need to replace the data source to the new feature class each time I run the script. How can I accomplish this?&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2023 22:00:06 GMT</pubDate>
    <dc:creator>Ivy_Hinson</dc:creator>
    <dc:date>2023-10-26T22:00:06Z</dc:date>
    <item>
      <title>Python script to change data source of feature layer</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/python-script-to-change-data-source-of-feature/m-p/1342391#M55363</link>
      <description>&lt;P&gt;I am trying to write a script that updates a feature layer on arcgis online. I need to replace the data source to the new feature class each time I run the script. How can I accomplish this?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 22:00:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/python-script-to-change-data-source-of-feature/m-p/1342391#M55363</guid>
      <dc:creator>Ivy_Hinson</dc:creator>
      <dc:date>2023-10-26T22:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to change data source of feature layer</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/python-script-to-change-data-source-of-feature/m-p/1342398#M55364</link>
      <description>&lt;P&gt;Assuming you're talking about hosted feature layers (as opposed to those coming from Enterprise), I could be mistaken but I don't believe this is possible.&amp;nbsp; Feature classes are completely abstracted away in AGOL, and users (along with the API) only have access to feature layers.&lt;/P&gt;&lt;P&gt;I'm going to take a guess and speculate you want to do this to make web maps, apps, forms, etc. use an updated data source, rather than modifying the maps/apps/etc. to use to a new feature layer?&amp;nbsp; I believe it's possible to change the source of a feature layer view (although I'm not sure how to do it in Python), so a solution may be to do this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Initially:&lt;UL&gt;&lt;LI&gt;Publish a feature layer&lt;/LI&gt;&lt;LI&gt;Create feature layer views&lt;/LI&gt;&lt;LI&gt;Configure your maps/apps/etc. to use the views&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;When an update is required:&lt;UL&gt;&lt;LI&gt;Publish your updated feature layer&lt;/LI&gt;&lt;LI&gt;Alter the views to use the new layer as their sources&lt;/LI&gt;&lt;LI&gt;Delete the original layer&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Thu, 26 Oct 2023 22:16:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/python-script-to-change-data-source-of-feature/m-p/1342398#M55364</guid>
      <dc:creator>MobiusSnake</dc:creator>
      <dc:date>2023-10-26T22:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Python script to change data source of feature layer</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/python-script-to-change-data-source-of-feature/m-p/1366596#M56684</link>
      <description>&lt;P&gt;Why are you needing to replace the data source? Can you not truncate and append the data in your hosted feature layer to accomplish what you are needing?&lt;/P&gt;&lt;P&gt;Also, AGOL now has the ability to swap views so if you want to do something like that it could be helpful.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 22:51:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/python-script-to-change-data-source-of-feature/m-p/1366596#M56684</guid>
      <dc:creator>MeganWheatley</dc:creator>
      <dc:date>2024-01-04T22:51:53Z</dc:date>
    </item>
  </channel>
</rss>

