<?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: Unable to get set_value to work when updating the attributes of a feature in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-get-set-value-to-work-when-updating-the/m-p/767999#M591</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks you are not pushing the changes you made in-memory. Can you try this: call the `edit_features()` method on your FeatureLayer object, pass the changes to the `updates` parameter and then try to query using either the REST endpoint or download as shapefile.&lt;/P&gt;&lt;P&gt;The workflow for editing is explained here&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/guide/editing-features/#Updating-features"&gt;https://developers.arcgis.com/python/guide/editing-features/#Updating-features&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Apr 2017 23:04:25 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2017-04-24T23:04:25Z</dc:date>
    <item>
      <title>Unable to get set_value to work when updating the attributes of a feature</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-get-set-value-to-work-when-updating-the/m-p/767998#M590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to use the set_value function on a feature in a feature layer hosted on AGOL. The set_value function seems to work and does not return an error but when I query the feature service none of the features&amp;nbsp;have the updated values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set up a layer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dataSearch = gis.content.search("pointService", "feature service")&lt;BR /&gt; for layer in dataSearch[0].layers:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;if layer.properties.name == "pointService":&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;pointLayer = layer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I get the feature set for that layer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;updateFeatures = pointLayer.query()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I try to set the values of some attributes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for feature in&amp;nbsp;&lt;SPAN&gt;updateFeatures.features&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;feature.set_value('RegionID', 1)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;feature&lt;/SPAN&gt;.set_value('RegionNm', "SouthEast")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The updated attributes show up when I use get_value()&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;print(str(&lt;SPAN&gt;feature&lt;/SPAN&gt;.get_value('RegionNm')))&lt;/P&gt;&lt;P&gt;&amp;lt;SouthEast&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I query the feature service from the REST endpoint or download it as a shapefile, the attributes are empty. I have tried using the refresh() method on the feature layer manager but it had no effect.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Apr 2017 22:54:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-get-set-value-to-work-when-updating-the/m-p/767998#M590</guid>
      <dc:creator>CharlieWare</dc:creator>
      <dc:date>2017-04-24T22:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get set_value to work when updating the attributes of a feature</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-get-set-value-to-work-when-updating-the/m-p/767999#M591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks you are not pushing the changes you made in-memory. Can you try this: call the `edit_features()` method on your FeatureLayer object, pass the changes to the `updates` parameter and then try to query using either the REST endpoint or download as shapefile.&lt;/P&gt;&lt;P&gt;The workflow for editing is explained here&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/guide/editing-features/#Updating-features"&gt;https://developers.arcgis.com/python/guide/editing-features/#Updating-features&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Apr 2017 23:04:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-get-set-value-to-work-when-updating-the/m-p/767999#M591</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-04-24T23:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get set_value to work when updating the attributes of a feature</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-get-set-value-to-work-when-updating-the/m-p/768000#M592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well that works - thanks. I also got it to work using the calculate() function on the feature layer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the intended use of the set_value() function? Is there a method to push changes from in_memory?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Apr 2017 23:45:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-get-set-value-to-work-when-updating-the/m-p/768000#M592</guid>
      <dc:creator>CharlieWare</dc:creator>
      <dc:date>2017-04-24T23:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to get set_value to work when updating the attributes of a feature</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-get-set-value-to-work-when-updating-the/m-p/768001#M593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The set_value() is powerful in that, you can use it to safely set or update not only attribute values of a feature but also its geometry. If you constructed your geometry as a&amp;nbsp;&lt;CODE class="" style="color: #000000; background: transparent; border: none; font-weight: bold;"&gt;arcgis.geometry.&lt;/CODE&gt;&lt;CODE class="" style="color: #000000; background: transparent; border: none; font-weight: bold;"&gt;Polyline &lt;/CODE&gt;object say, you can call the set_value('geometry', your_polyline_obj) and the API takes care of updating the geometry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still, the changes are local. You need to call the update() as discussed earlier if you want to push them to the server and persist.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Apr 2017 00:16:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-get-set-value-to-work-when-updating-the/m-p/768001#M593</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2017-04-25T00:16:18Z</dc:date>
    </item>
  </channel>
</rss>

