<?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: Error 498 when updating feature layer in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-498-when-updating-feature-layer/m-p/1536943#M72804</link>
    <description>&lt;P&gt;Hey, Jake. That works well. Thanks for helping me out.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Sep 2024 16:34:41 GMT</pubDate>
    <dc:creator>AnthonyCastelletto</dc:creator>
    <dc:date>2024-09-10T16:34:41Z</dc:date>
    <item>
      <title>Error 498 when updating feature layer</title>
      <link>https://community.esri.com/t5/python-questions/error-498-when-updating-feature-layer/m-p/1535647#M72791</link>
      <description>&lt;P&gt;Hello Python Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I'm attempting to update a feature layer in Arc GIS Online using Arc GIS Pro's Python Notebooks. I'm fairly competent with Python, but quite new to working with the Python API for Arc GIS Onine. I've been able to connect, find my layer, retrieve features, and edit them. The final step is updating the layer and that's where I've hit a snag. When I execute the update, I get an Invalid Token error (error 498). Can anyone point me towards a solution or show me what I've done wrong?&lt;/P&gt;&lt;P&gt;The code looks something like this:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;boocGIS = GIS(host="&lt;A href="https://arcgis.com/" target="_blank" rel="noopener"&gt;https://arcgis.com/&lt;/A&gt;", client_id="my_client_id")&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;boocContent = boocGIS.content.advanced_search(query="id: my_feature_id", max_items=max_items)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;boocCase = boocGeography.layers[0].query()&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#To test my ability to update, I feed the search a specific record id&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#Since we describe our records as cases, the attribute is caseID and 1087&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;#refers to a specific case.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;boocCase_feature = [f for f in boocCase if f.attributes['caseID']=='1087'][0]&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#Now set some keywords in our case to help users find what they're looking for&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;boocEdit = boocCase_feature&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;boocEdit.attributes['keywords'] = 'Marine heatwave prediction forecast aquaculture fishing recreation model, test'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;#Now update. This is where I run into the problem&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;update_result = boocGeography.edit_features(updates=[boocEdit])&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;update_result&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The code above will in end in the invalid token error.&lt;/P&gt;&lt;P&gt;BOOC stands for Benefits of Ocean Observing Catalog and this will be a GIS enabled catalog of applications of the Integrated Ocean Observing System.&amp;nbsp; Thanks in advance for all your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 19:39:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-498-when-updating-feature-layer/m-p/1535647#M72791</guid>
      <dc:creator>AnthonyCastelletto</dc:creator>
      <dc:date>2024-09-05T19:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error 498 when updating feature layer</title>
      <link>https://community.esri.com/t5/python-questions/error-498-when-updating-feature-layer/m-p/1536415#M72799</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/540468"&gt;@AnthonyCastelletto&lt;/a&gt;,&amp;nbsp;below is code I use to perform updates:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS

# Variables
client_id = 'pVmEFq81pBTL'
itemId = '3df4deee1a9940519fab3e2c5c5c85f2'

# Connect to AGOL
gis = GIS(host="https://arcgis.com", client_id=client_id)

# Reference layer
lyr = gis.content.get(itemId)

layers = lyr.layers
fset = layers[0].query()
flayer = layers[0]
features = fset.features

# Query feature and update
boocCase_feature = [f for f in features if f.attributes['caseID']=='1087'][0]
boocCase_feature.attributes['keywords'] = 'Marine heatwave prediction forecast aquaculture fishing recreation model, test'
update_result = flayer.edit_features(updates=[boocCase_feature])
print(update_result)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 09 Sep 2024 13:53:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-498-when-updating-feature-layer/m-p/1536415#M72799</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2024-09-09T13:53:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error 498 when updating feature layer</title>
      <link>https://community.esri.com/t5/python-questions/error-498-when-updating-feature-layer/m-p/1536943#M72804</link>
      <description>&lt;P&gt;Hey, Jake. That works well. Thanks for helping me out.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2024 16:34:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-498-when-updating-feature-layer/m-p/1536943#M72804</guid>
      <dc:creator>AnthonyCastelletto</dc:creator>
      <dc:date>2024-09-10T16:34:41Z</dc:date>
    </item>
  </channel>
</rss>

