<?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: Update Feature with ArcGIS API for Python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770555#M662</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Simo Xu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a good day&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Aug 2018 00:05:22 GMT</pubDate>
    <dc:creator>PierreWeisse1</dc:creator>
    <dc:date>2018-08-29T00:05:22Z</dc:date>
    <item>
      <title>Update Feature with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770553#M660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;Hello, I work with ArcGIS API for Python on a service hosted in AGOL. I would like to update a field based on another field. I have tried many times, I do not understand how to do it. The example in the API is based on the update between two documents. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;Someone to help me ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2018 05:10:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770553#M660</guid>
      <dc:creator>PierreWeisse1</dc:creator>
      <dc:date>2018-08-28T05:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Update Feature with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770554#M661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hope the following code snippet&amp;nbsp;gives you some clue:&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; FeatureSet&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Feature

gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;url&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&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;""&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;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
fs&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;get&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;itemId&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# assume the first layer is the layer you want to update&lt;/SPAN&gt;
fl&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;fs&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;layers&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# set return_geometry false will save you time and data &lt;/SPAN&gt;
features&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;fl&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;query&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;where&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;sql_where&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;out_fields&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'OBJECTID,FieldName'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;return_geometry&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; feature &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; features&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# Calculate the new value and assign it to the field in the current record&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;set_value&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'FieldName'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;NewValue&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# update the features in AGOL&lt;/SPAN&gt;
results &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; fl&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;features&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:36:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770554#M661</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2021-12-12T08:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: Update Feature with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770555#M662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Simo Xu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a good day&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2018 00:05:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770555#M662</guid>
      <dc:creator>PierreWeisse1</dc:creator>
      <dc:date>2018-08-29T00:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Update Feature with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770556#M663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are welcome, thank you &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Aug 2018 23:50:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770556#M663</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-08-29T23:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Update Feature with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770557#M664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;Hello Simo, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;Maybe you can help me on this point. I'm still working with this web service, hosted under AGOL and with ArcGIS API for Python. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;On a field of type 'date', I would like to empty the field of its contents. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;However when I try, here is the result 1/1/1900 11h05 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;Do you have an idea ? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #212121; background-color: #ffffff; font-size: 16px;"&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2018 03:09:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770557#M664</guid>
      <dc:creator>PierreWeisse1</dc:creator>
      <dc:date>2018-09-25T03:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Update Feature with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770558#M665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know how you did it, but could you test whether or not the following code works?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="" style="color: #000000; background: #f5f2f0; border: 0px; margin: 0.5em 0px; padding: 1em 1em 1em 3.8em;"&gt;&lt;CODE style="border: 0px; font-weight: inherit;"&gt;feature&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;.&lt;/SPAN&gt;set_value&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="" style="color: #669900; border: 0px; font-weight: inherit;"&gt;'DateFieldName'&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;,None&lt;/SPAN&gt;&lt;SPAN class="" style="color: #999999; border: 0px; font-weight: inherit;"&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2018 06:28:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770558#M665</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-09-25T06:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Update Feature with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770559#M666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With your proposal it does not change. The content of the field remains the same.&lt;/P&gt;&lt;P&gt;Before asking for your help I tried this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;feature.set_value('DateFieldName',"")&lt;BR /&gt;RESULT &amp;gt;&amp;gt; 1/1/1900 11:05 AM&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The field settings have this parameter.&lt;BR /&gt;Allow null values is set to Yes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2018 22:22:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770559#M666</guid>
      <dc:creator>PierreWeisse1</dc:creator>
      <dc:date>2018-09-25T22:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Update Feature with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770560#M667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are right.&lt;/P&gt;&lt;P&gt;I tried SQL in Map Viewer, it didn't work either.&lt;/P&gt;&lt;P&gt;I have to manually do it in AGOL Map Viewer using Arcade expression to set the Date column to NULL. But I am not sure this is what you want.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2018 08:48:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770560#M667</guid>
      <dc:creator>simoxu</dc:creator>
      <dc:date>2018-09-26T08:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Update Feature with ArcGIS API for Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770561#M668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very nicely done.&amp;nbsp; I wish the Esri help documentation on this topic was this straightforward and to the point.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Aug 2019 20:49:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/update-feature-with-arcgis-api-for-python/m-p/770561#M668</guid>
      <dc:creator>JonathanPollack1</dc:creator>
      <dc:date>2019-08-21T20:49:30Z</dc:date>
    </item>
  </channel>
</rss>

