<?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: replace file path in table for AGOL hosted feature layer in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800906#M2065</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That NameError is odd.&amp;nbsp; Does your version of the script include the line that imports the FeatureLayer module?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;features &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; FeatureLayer&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Dec 2018 21:51:23 GMT</pubDate>
    <dc:creator>FFSL_-_JustinJohnson</dc:creator>
    <dc:date>2018-12-28T21:51:23Z</dc:date>
    <item>
      <title>replace file path in table for AGOL hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800898#M2057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm looking for a way to change the file path of 100+ fields in a table of a feature layer. I have Jupyter Notebook installed. I'm guessing it can be done with Python? I'm pretty familiar with arcpy, but I've never used python inside AGOL before.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We recently set up a new server. This 'Attractions' layer (below) has pop-ups and in the pop-ups are links to images. But the file path to these images is to the old server. I want to use python to replace this old path with the updated one.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="432035" alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/432035_asol.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2018 16:17:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800898#M2057</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2018-12-19T16:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: replace file path in table for AGOL hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800899#M2058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you done much with Python's string methods?&amp;nbsp; The code below should get you most of the way there.&amp;nbsp; It's based on the steps outlined here:&amp;nbsp; &lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/editing-features/" title="https://developers.arcgis.com/python/guide/editing-features/" rel="nofollow noopener noreferrer" target="_blank"&gt;Editing Features | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will need the URL of your organization account and your username/password, and the URL of the Feature Layer you want to edit.&amp;nbsp; After that, you'll need the name of the field containing the URL strings.&amp;nbsp; Then, you'll need to write the expression to change the current value in the field to the desired value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you have any issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;features &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; FeatureLayer

&lt;SPAN class="comment token"&gt;# create the GIS object from the arcgis.gis module&lt;/SPAN&gt;
gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2F%5Byour" target="_blank"&gt;http://[your&lt;/A&gt;&lt;SPAN&gt; organization name].maps.arcgis.com"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; username&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"[your username]"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; password&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"[your password]"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# get the Feature Layer from the Feature Layer URL&lt;/SPAN&gt;
feat_layer_url &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fservices.arcgis.com%2F%5B...%5D%2Farcgis%2Frest%2Fservices%2F" target="_blank"&gt;https://services.arcgis.com/[...]/arcgis/rest/services/&lt;/A&gt;&lt;SPAN&gt;[ ...]/FeatureServer/0'&lt;/SPAN&gt;&lt;/SPAN&gt;
feat_layer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; FeatureLayer&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;feat_layer_url&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# query/get a list of features from the feature layer:&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# an empty query string will return all the features or the first 1000 which ever is smaller&lt;/SPAN&gt;
existing_feats &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; feat_layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;query&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# loop through the features and udpate an attribute value in each&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; feat &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; existing_feats&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# create a copy of the feature&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# this will be used to update the current feature in the Feature Layer after editing&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; edit_feat &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; feat

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# here is where the changes are made to the attribute value&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# use any Python string methods you need, i.e. replace() or slice, to update the field value&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ptname &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; feat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'URL_FIELD'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; newptname &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ptname&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;replace&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'oldurl'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'newurl'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; edit_feat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'URL_FIELD'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; newptname

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# use the changed copy of the feature to update the attributes of the current feature&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; feat_layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;edit_features&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;updates&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;edit_feat&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:17:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800899#M2058</guid>
      <dc:creator>FFSL_-_JustinJohnson</dc:creator>
      <dc:date>2021-12-12T09:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: replace file path in table for AGOL hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800900#M2059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.5pt; color: #3d3d3d;"&gt;Just to clarify: you have 100+ fields or do you have a single hosted feature layer with 2 fields and 100+ records (as shown in the screenshot). If it is the latter a simple field calculation should do the job. However, if you need to&amp;nbsp;&lt;/SPAN&gt;walk through many fields, the Python API is the way to go.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Dec 2018 12:20:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800900#M2059</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-12-27T12:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: replace file path in table for AGOL hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800901#M2060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I have a single hosted feature layer with 2 fields and 100+ records. Ok, good to know. Thanks.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2018 15:02:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800901#M2060</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2018-12-28T15:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: replace file path in table for AGOL hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800902#M2061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Justin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. I've been attempting your code.&amp;nbsp;It seems as though it almost ran. But there was an error of sorts, something about 'no permission'.&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'addResults'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="string token"&gt;'deleteResults'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 &lt;SPAN class="string token"&gt;'updateResults'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'error'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'code'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1009&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;'description'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'No permission to edit the specified feature.'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;'globalId'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;'objectId'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;52&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;'success'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="string token"&gt;'uniqueId'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;52&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:17:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800902#M2061</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-12-12T09:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: replace file path in table for AGOL hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800903#M2062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't seem to reproduce your error, but from this other GeoNet post, it looks like it may be a permissions issue with the Feature Service:&amp;nbsp;&amp;nbsp;&lt;A href="https://community.esri.com/thread/194183-unable-to-edit-submitted-surveys-send-error-code-1009"&gt;https://community.esri.com/thread/194183-unable-to-edit-submitted-surveys-send-error-code-1009&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you able to make edits to the Feature Service when you log in to ArcGIS Online with the username and password you're using in the script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2018 17:45:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800903#M2062</guid>
      <dc:creator>FFSL_-_JustinJohnson</dc:creator>
      <dc:date>2018-12-28T17:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: replace file path in table for AGOL hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800904#M2063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/297053"&gt;Jared Pilbeam&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that case I think it might be easier to just perform two field calculations on the hosted feature layer. You could use Arcade for this:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/432344_pastedImage_2.png" /&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2018 19:38:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800904#M2063</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2018-12-28T19:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: replace file path in table for AGOL hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800905#M2064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My mistake, I wasn't the originator of that Feature Layer. I couldn't edit it in AGOL either. So, I added a copy and ran the script on it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm getting a NameError.&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;NameError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; name &lt;SPAN class="string token"&gt;'FeatureLayer'&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; defined&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, here's how I have it:&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;feat_layer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; FeatureLayer&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;feat_layer_url&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the&amp;nbsp;&lt;STRONG&gt;feat_layer_url&amp;nbsp;&lt;/STRONG&gt;is the new URL, which is valid.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2018 20:54:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800905#M2064</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2018-12-28T20:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: replace file path in table for AGOL hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800906#M2065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That NameError is odd.&amp;nbsp; Does your version of the script include the line that imports the FeatureLayer module?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;features &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; FeatureLayer&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2018 21:51:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800906#M2065</guid>
      <dc:creator>FFSL_-_JustinJohnson</dc:creator>
      <dc:date>2018-12-28T21:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: replace file path in table for AGOL hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800907#M2066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's how the script looks; minus the correct URL.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;#get the feature layer from the feature layer URL&lt;/SPAN&gt;
feat_layer_url &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fservices.arcgis.com" target="_blank"&gt;https://services.arcgis.com&lt;/A&gt;&lt;SPAN&gt;...'&lt;/SPAN&gt;&lt;/SPAN&gt;
feat_layer &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; FeatureLayer&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;feat_layer_url&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# query/get a list of features from the feature layer:&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# an empty query string will return all the features or the first 1000 which ever is smaller&lt;/SPAN&gt;
existing_feats &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; feat_layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;query&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#loop through the features and update an attribute value in each&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; feat &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; existing_feats&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#create a copy of the feature&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#this will be used to update the current feature in the Feature Layer after editing&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; edit_feat &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; feat
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#here is where the changes are made to the attribute value&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#use any Python string mehtods you need, i.e.. replace() or slice, to update the field value&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; ptname &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; feat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Photo'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; newptname &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ptname&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;replace&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fwww.willcogis.org%2Fwebsite2014%2Fgis%2Fimages%2Fharrahs.png" target="_blank"&gt;http://www.willcogis.org/website2014/gis/images/harrahs.png&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwebapp.willcountyillinois.com%2Fgisweb%2Fimages%2Fcretelibrary.png" target="_blank"&gt;https://webapp.willcountyillinois.com/gisweb/images/cretelibrary.png&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; edit_feat&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Photo'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; newptname
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# use the changed copy of the feature to update the attributes of the current feature&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; feat_layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;edit_features&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;updates&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;edit_feat&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'finished'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:17:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800907#M2066</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-12-12T09:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: replace file path in table for AGOL hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800908#M2067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there more to your version of the script than that?&amp;nbsp; It looks like you're missing the first 5 lines (unless you didn't copy/paste that section).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;features &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; FeatureLayer

&lt;SPAN class="comment token"&gt;# create the GIS object from the arcgis.gis module&lt;/SPAN&gt;
gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2F%5Byour" target="_blank"&gt;http://[your&lt;/A&gt;&lt;SPAN&gt; organization name].maps.arcgis.com"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; username&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"[your username]"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; password&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"[your password]"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're trying to run it exactly as it appears in your previous message, it would be the cause of the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;'&lt;CODE&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;FeatureLayer'&lt;/SPAN&gt; &lt;SPAN class="" style="color: #0077aa; border: 0px; font-weight: inherit;"&gt;is&lt;/SPAN&gt; &lt;SPAN class="" style="color: #a67f59; background: rgba(255, 255, 255, 0.5); border: 0px; font-weight: inherit;"&gt;not&lt;/SPAN&gt; defined&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:17:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800908#M2067</guid>
      <dc:creator>FFSL_-_JustinJohnson</dc:creator>
      <dc:date>2021-12-12T09:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: replace file path in table for AGOL hosted feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800909#M2068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Justin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, those five lines are not pasted. I did run the entire script.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm getting an HTTPError.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;RuntimeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; HTTPError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; this service url encountered an HTTP Error&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The HTTPError happens when I include the token at the end of the&amp;nbsp;&lt;STRONG&gt;feat_layer_url&lt;/STRONG&gt;. And there doesn't seem to be a problem with the URL. It works fine when I put it in the browser window(s). If I remove the token I get a RuntimeError on line 22.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;RuntimeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; 
This operation &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; supported&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
Unable to update the features&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
This operation &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; supported&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;Error Code&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;400&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:17:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/replace-file-path-in-table-for-agol-hosted-feature/m-p/800909#M2068</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-12-12T09:17:20Z</dc:date>
    </item>
  </channel>
</rss>

