<?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: ArcGIS javascript API Update Records of a Feature Layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549655#M51202</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Yes. You need to enable editing on your feature layer.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help, but how to set it editable? sorry I know it is a idiot question, but I'm really confused.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Oct 2013 16:13:15 GMT</pubDate>
    <dc:creator>yufeizhuang</dc:creator>
    <dc:date>2013-10-21T16:13:15Z</dc:date>
    <item>
      <title>ArcGIS javascript API Update Records of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549651#M51198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm new to ArcGIS javascript API, now I want to create a feature layer and then add an array of attributes or simply update the array of attributes of a specific field. I only need to replace the original values array as my own array. Is that possible? There's a method: attr(name,value), Can I use this? Can any one give me some hints or code? Thanks in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Oct 2013 02:55:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549651#M51198</guid>
      <dc:creator>yufeizhuang</dc:creator>
      <dc:date>2013-10-14T02:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS javascript API Update Records of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549652#M51199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can use &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/en/javascript/jsapi/featurelayer-amd.html#applyedits" rel="nofollow" target="_blank"&gt;FeatureLayer.applyEdits(adds?,updates?,deletes?,callback?,errback?)&lt;/A&gt;&lt;SPAN&gt;. To update the attributes of an existing feature, you need to provide the feature's object ID, create a new &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/en/javascript/jsapi/graphic-amd.html" rel="nofollow" target="_blank"&gt;Graphic&lt;/A&gt;&lt;SPAN&gt;, and make an array of graphics as the input for the updateFeatures parameter. For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;var attributes = { &amp;nbsp; OBJECTID: 12, &amp;nbsp; name: "My name" }; var feature = new Graphic(null, null, attributes);&amp;nbsp; var updateFeatures = []; updateFeatures.push(feature);&amp;nbsp; layer.applyEdits(null, updateFeatures, null, function(addResults, updateResults, deleteResults){ &amp;nbsp; console.log('success', updateResults); }, function(error){ &amp;nbsp; console.log('error', error); });&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To add new features, use &lt;/SPAN&gt;&lt;STRONG&gt;layer.applyEdits(addFeatures, null, null, ...)&lt;/STRONG&gt;&lt;SPAN&gt; instead. The process of making an array of graphics as the &lt;/SPAN&gt;&lt;STRONG&gt;addFeatures&lt;/STRONG&gt;&lt;SPAN&gt; input is similar to the code snippet above, except you don't need to specify OBJECTID.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Oct 2013 15:26:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549652#M51199</guid>
      <dc:creator>JanelYang</dc:creator>
      <dc:date>2013-10-14T15:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS javascript API Update Records of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549653#M51200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you very much for your replying! I'm still confused how to specify the objectID and do I need to set the feature layer as editable before I can do any modifications?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Oct 2013 20:56:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549653#M51200</guid>
      <dc:creator>yufeizhuang</dc:creator>
      <dc:date>2013-10-14T20:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS javascript API Update Records of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549654#M51201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I'm still confused how to specify the objectID&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;The objectID helps the feature server identify which existing feature you are updating. By default it's one of the attributes of the &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Feature/02r3000000pr000000/"&gt;feature&lt;/A&gt;&lt;SPAN&gt; object. You can get it by &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/featurelayer-amd.html#queryfeatures"&gt;querying a feature layer&lt;/A&gt;&lt;SPAN&gt; and include ObjectID in the outFields. Check out &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jssamples/fl_paging.html"&gt;this sample&lt;/A&gt;&lt;SPAN&gt;. The code snippets in the description section might be what you need.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;do I need to set the feature layer as editable before I can do any modifications?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes. You need to enable editing on your feature layer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Oct 2013 15:35:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549654#M51201</guid>
      <dc:creator>JanelYang</dc:creator>
      <dc:date>2013-10-15T15:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS javascript API Update Records of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549655#M51202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;Yes. You need to enable editing on your feature layer.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help, but how to set it editable? sorry I know it is a idiot question, but I'm really confused.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 16:13:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549655#M51202</guid>
      <dc:creator>yufeizhuang</dc:creator>
      <dc:date>2013-10-21T16:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS javascript API Update Records of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549656#M51203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks for your help, but how to set it editable? sorry I know it is a idiot question, but I'm really confused.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;If your feature service is hosted on your arcgis.com account, go to the item page, click "edit", then scroll down to the "properties" section, modify the settings of editing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]28489[/ATTACH][ATTACH=CONFIG]28490[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to do so with REST API, here is a reference you may look at: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Update_Definition_Feature_Layer/02r30000022p000000/"&gt;Update Definition&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2013 17:20:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549656#M51203</guid>
      <dc:creator>JanelYang</dc:creator>
      <dc:date>2013-10-21T17:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS javascript API Update Records of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549657#M51204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I set it editable as the picture but when I test it using featureLayer.isEditable(), why it still returns false?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Oct 2013 00:07:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549657#M51204</guid>
      <dc:creator>yufeizhuang</dc:creator>
      <dc:date>2013-10-22T00:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS javascript API Update Records of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549658#M51205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I set it editable as the picture but when I test it using featureLayer.isEditable(), why it still returns false?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All properties of a feature layer are loaded asynchronously. That is, you can only get correct values AFTER the feature layer is loaded.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Try placing featurelayer.isEditable() inside &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/featurelayer-amd.html#load" rel="nofollow noopener noreferrer" target="_blank"&gt;featurelayer.on("load")&lt;/A&gt;&lt;SPAN&gt;. It should reflect the editing setting of the feature layer correctly:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;featurelayer.on("load", function(){
&amp;nbsp; console.log(featurelayer.isEditable());
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:46:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549658#M51205</guid>
      <dc:creator>JanelYang</dc:creator>
      <dc:date>2021-12-11T23:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS javascript API Update Records of a Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549659#M51206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Example 1&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;var map = new Map("map", {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;basemap: "dark-gray",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;zoom: 3,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN&gt;layer = new FeatureLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FDamageAssessment%2FFeatureServer%2F0" rel="nofollow" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;attributes = { objectid: 119369, typdamage: "Update successfully" };&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;feature = new Graphic( null, null, attributes );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;map.addLayer(layer);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;map.&lt;STRONG&gt;onLayerAddResult&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= () =&amp;gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;layer.applyEdits(null, [feature], null,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;function (add, update, del) {&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;console.log('success', update);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;});&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;};&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Exemple 2&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;var map = new Map("map", {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;basemap: "dark-gray",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;zoom: 3,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;SPAN&gt;layer = new FeatureLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FDamageAssessment%2FFeatureServer%2F0" rel="nofollow" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;attributes = { objectid: 119369, typdamage: "Update successfully" };&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;feature = new Graphic( null, null, attributes );&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;map.addLayer(layer);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;STRONG&gt;setTimeout&lt;/STRONG&gt;(() =&amp;gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;layer.applyEdits(null, [feature], null,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;function (add, update, del) {&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;console.log('success', update);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;},&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;function (error) {&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;console.log('error applyEdits \n', error);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;}, 2000);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bertrand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Dec 2017 08:31:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-javascript-api-update-records-of-a-feature/m-p/549659#M51206</guid>
      <dc:creator>BertrandLAURANCIN</dc:creator>
      <dc:date>2017-12-20T08:31:40Z</dc:date>
    </item>
  </channel>
</rss>

