<?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: applyEdits attributes not updating in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-attributes-not-updating/m-p/1032306#M71906</link>
    <description>&lt;P&gt;Hi All: just an update to this.&amp;nbsp; I changed my code so that "&lt;SPAN&gt;hostfeatureLayer" used a featureLayer that was a direct reference to an SDE layer.&amp;nbsp; It is the original SDE layer that I published the hosted featurelayer from, so it has the exact same schema.&amp;nbsp; Just changing to that made it so that I can assign the attributes when I create the geometry of the feature.&amp;nbsp; I would VERY MUCH prefer to be able to publish this layer as Hosted and update the attributes.&amp;nbsp; Has anyone been successful in doing this?&amp;nbsp; Does the code structure need to change in some way?&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Mar 2021 03:44:43 GMT</pubDate>
    <dc:creator>LisaT</dc:creator>
    <dc:date>2021-03-03T03:44:43Z</dc:date>
    <item>
      <title>applyEdits attributes not updating</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-attributes-not-updating/m-p/1031796#M71898</link>
      <description>&lt;P&gt;I am trying to add new features to a hosted feature service via a custom tool in Portal (currently Enterprise 10.7.1).&amp;nbsp; I am using "applyEdits". It is setting the geometry, but I can't seem to get my code to also set the attributes.&amp;nbsp; I have tried many things (see my commented-out code) but the result is always that the geometry is added without any attributes. An objectid is auto-calculated. I have created a featureclass with one text attribute.&amp;nbsp; Here is the code I have tried:&lt;/P&gt;&lt;P&gt;var hostfeatureLayer = new FeatureLayer("&lt;A href="https://ourCompany.domain/arcgis/rest/services/Hosted/myTest_featureClass/FeatureServer/0" target="_blank"&gt;https://ourCompany.domain/arcgis/rest/services/Hosted/myTest_featureClass/FeatureServer/0&lt;/A&gt;");&lt;BR /&gt;&lt;BR /&gt;let features = [];&lt;/P&gt;&lt;P&gt;var attr = { "testText": "Mesa Mint" };&lt;BR /&gt;let graphic = new Graphic(geometry, null, attr);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Ive also tried:&lt;BR /&gt;// let attr = {};&lt;BR /&gt;// attr.testText = "tester";&lt;/P&gt;&lt;P&gt;//let graphic = new Graphic({&lt;BR /&gt;// geometry: geometry,&lt;BR /&gt;// attributes: {&lt;BR /&gt;// "testText": "test"&lt;BR /&gt;// }&lt;BR /&gt;//});&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// let graphic = new Graphic(geometry);&lt;BR /&gt;// graphic.setAttributes(attr);&lt;/P&gt;&lt;P&gt;// graphic.attributes["testText"] = "tester";&lt;BR /&gt;&lt;BR /&gt;features.push(graphic);&lt;/P&gt;&lt;P&gt;hostfeatureLayer.applyEdits(features, null, null).then(function (adds, updates, deletes) {&lt;BR /&gt;console.log('success', adds);&lt;BR /&gt;}, function (err) {&lt;BR /&gt;console.log(err);&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In looking at all of the code samples, one of these should work.&amp;nbsp; When looking at the graphic properties after it is created, many of these attempts correctly fill in the "attributes" property of the Graphics object.&amp;nbsp; However, "applyEdits" doesn't apply them! If I put a breakpoint on the "console.log('success' line, the "add" object does not show any attributes.&amp;nbsp; Any ideas what I am doing wrong here?&amp;nbsp; The hosted feature service is set up for add, update and delete.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 06:32:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-attributes-not-updating/m-p/1031796#M71898</guid>
      <dc:creator>LisaT</dc:creator>
      <dc:date>2021-03-02T06:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: applyEdits attributes not updating</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-attributes-not-updating/m-p/1032306#M71906</link>
      <description>&lt;P&gt;Hi All: just an update to this.&amp;nbsp; I changed my code so that "&lt;SPAN&gt;hostfeatureLayer" used a featureLayer that was a direct reference to an SDE layer.&amp;nbsp; It is the original SDE layer that I published the hosted featurelayer from, so it has the exact same schema.&amp;nbsp; Just changing to that made it so that I can assign the attributes when I create the geometry of the feature.&amp;nbsp; I would VERY MUCH prefer to be able to publish this layer as Hosted and update the attributes.&amp;nbsp; Has anyone been successful in doing this?&amp;nbsp; Does the code structure need to change in some way?&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 03:44:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-attributes-not-updating/m-p/1032306#M71906</guid>
      <dc:creator>LisaT</dc:creator>
      <dc:date>2021-03-03T03:44:43Z</dc:date>
    </item>
  </channel>
</rss>

