<?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: How to Update attributes in an Online Feature Layer using Selection in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1088211#M6470</link>
    <description>&lt;P&gt;Hi Chuck,&lt;/P&gt;&lt;P&gt;I think&amp;nbsp; &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#arcgis.features.FeatureLayer.calculate" target="_blank" rel="noopener"&gt;FeatureLayer.calculate&lt;/A&gt; is what you are looking for.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Aug 2021 23:53:20 GMT</pubDate>
    <dc:creator>DavinWalker2</dc:creator>
    <dc:date>2021-08-11T23:53:20Z</dc:date>
    <item>
      <title>How to Update attributes in an Online Feature Layer using Selection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1088181#M6469</link>
      <description>&lt;P&gt;I have a large feature layer hosted in ArcGIS Online. I want to select a subset by matching a field attribute to a value, and then update another field to specific value. Ideally I'd prefer not to iterate through any loops as the overall layer is &amp;gt; 150M records. The selection field is indexed and performs quickly, I just can't figure out how to modify/update the other field based on the selection. I've seen arcpy solutions that work with shapefiles and fgdbs, but nothing for Online.&lt;/P&gt;&lt;P&gt;Thanks in advance for any advice or pointers!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 21:55:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1088181#M6469</guid>
      <dc:creator>ChuckBenton</dc:creator>
      <dc:date>2021-08-11T21:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Update attributes in an Online Feature Layer using Selection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1088211#M6470</link>
      <description>&lt;P&gt;Hi Chuck,&lt;/P&gt;&lt;P&gt;I think&amp;nbsp; &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#arcgis.features.FeatureLayer.calculate" target="_blank" rel="noopener"&gt;FeatureLayer.calculate&lt;/A&gt; is what you are looking for.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Aug 2021 23:53:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1088211#M6470</guid>
      <dc:creator>DavinWalker2</dc:creator>
      <dc:date>2021-08-11T23:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to Update attributes in an Online Feature Layer using Selection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1088445#M6480</link>
      <description>&lt;P&gt;For this kind of thing, I'd recommend familiarizing yourself with Spatially Enabled DataFrames:&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/guide/introduction-to-the-spatially-enabled-dataframe/" target="_blank"&gt;https://developers.arcgis.com/python/guide/introduction-to-the-spatially-enabled-dataframe/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your general process will look like this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create a FeatureLayer object from the layer you want to update&lt;/LI&gt;&lt;LI&gt;Create an SEDF from the FeatureLayer&lt;/LI&gt;&lt;LI&gt;Perform your selections/manipulations in the SEDF.&amp;nbsp;When satisfied with the result, optionally create a version of the dataframe that only includes the field(s) you're updating and the unique identifier used for the update (ObjectID/GlobalID).&lt;/LI&gt;&lt;LI&gt;Convert the result dataframe to a feature set.&lt;/LI&gt;&lt;LI&gt;Execute an update operation with the FeatureLayer object's&amp;nbsp; "edit_features" method (your update is the feature set you created).&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 14:50:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1088445#M6480</guid>
      <dc:creator>emedina</dc:creator>
      <dc:date>2021-08-12T14:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to Update attributes in an Online Feature Layer using Selection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1088453#M6481</link>
      <description>&lt;P&gt;Thanks for the responses! featurelayer.calculate fit the bill. I'd skipped over it in my searches, because I'm not doing any "calculations". Once found it was an easy implementation. Thanks!!!&lt;/P&gt;&lt;P&gt;Chuck&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 15:02:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1088453#M6481</guid>
      <dc:creator>ChuckBenton</dc:creator>
      <dc:date>2021-08-12T15:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to Update attributes in an Online Feature Layer using Selection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1088535#M6483</link>
      <description>&lt;P&gt;I'm sure this is a simple issue, but it's stumped me.&lt;/P&gt;&lt;P&gt;The following line executes without issue:&lt;/P&gt;&lt;P&gt;fs_layer.calculate(where="FIPS=18039", calc_expression={"field":"VERSION", "value": "07/04/2021"})&lt;/P&gt;&lt;P&gt;This fails:&lt;/P&gt;&lt;P&gt;where_str = '"FIPS=18039"'&lt;BR /&gt;calc_str = '"field":"VERSION", "value":"07/10/2021"'&lt;BR /&gt;fs_layer.calculate(where=where_str, calc_expression={calc_str})&lt;/P&gt;&lt;P&gt;I've multiple ways to build the parameters to be passed, building the entire argument, varying quote schemes. What am I missing?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 17:00:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1088535#M6483</guid>
      <dc:creator>ChuckBenton</dc:creator>
      <dc:date>2021-08-12T17:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to Update attributes in an Online Feature Layer using Selection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1349117#M9287</link>
      <description>&lt;P&gt;Chuck,&lt;/P&gt;&lt;P&gt;looks like the difference is a dict versus a set containing a string.&lt;/P&gt;&lt;P&gt;This is a valid dict (key: value) and looks to be an acceptable parameter type for calculate&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;{"field":"VERSION", "value": "07/04/2021"}&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Simplifying your code your second option is: &lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;{'&amp;nbsp; &amp;nbsp; &amp;nbsp; "field":"VERSION",&amp;nbsp; &amp;nbsp; &amp;nbsp; "value":"07/10/2021"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'} I added spaces for clarity&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;notice the entire inner contents are quoted by ''&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;See sets&amp;nbsp;&lt;A href="https://python-reference.readthedocs.io/en/latest/docs/sets/" target="_blank"&gt;https://python-reference.readthedocs.io/en/latest/docs/sets/&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Your code puts a string inside of curly brackets ... calc_expression={calc_str}&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 13:03:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1349117#M9287</guid>
      <dc:creator>ConradSchaefer__DOIT_</dc:creator>
      <dc:date>2023-11-14T13:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to Update attributes in an Online Feature Layer using Selection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1349119#M9288</link>
      <description>&lt;P&gt;.calculate() proved to be very simple and precise. Didn't know it existed before but definitely valuable for very precise editing of individual field(s).&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 13:14:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1349119#M9288</guid>
      <dc:creator>ConradSchaefer__DOIT_</dc:creator>
      <dc:date>2023-11-14T13:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to Update attributes in an Online Feature Layer using Selection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1377653#M9615</link>
      <description>&lt;P&gt;This worked great - thanks for the workflow&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2024 17:06:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1377653#M9615</guid>
      <dc:creator>FrancisCorbett</dc:creator>
      <dc:date>2024-02-02T17:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to Update attributes in an Online Feature Layer using Selection</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1383608#M9665</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/214195"&gt;@DavinWalker2&lt;/a&gt;&amp;nbsp;Hi Davin, it not does work with me when I am passing my own value to be updated for an attribute. However, it works if I pass the column name&amp;nbsp; ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;This does not work&lt;/STRONG&gt;:&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;fs_layer.calculate(where="FIPS=18039", calc_expression={"field":"FIELDNAME1", "value":"newattributevalue"}) // this returns an error&amp;nbsp;PerformEdit() failure. ColumnName='newattributevalue' not found in field name map. (Error Code: 400)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;This works&lt;/STRONG&gt;:&amp;nbsp;fs_layer.calculate(where="FIPS=18039", calc_expression={"field":"FIELDNAME1", "value":"FIELDNAME2"}) // this one copies the value from FIELDNAME2 to FIELDNAME1. Is this how calculate works?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 20:20:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/how-to-update-attributes-in-an-online-feature/m-p/1383608#M9665</guid>
      <dc:creator>MirHashmi</dc:creator>
      <dc:date>2024-02-16T20:20:18Z</dc:date>
    </item>
  </channel>
</rss>

