<?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: Hi I want to create a feature from the Editor widget and when its created i want to apply the value in the back end which needs to updated on the in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hi-i-want-to-create-a-feature-from-the-editor/m-p/1227078#M79177</link>
    <description>&lt;P&gt;Since the Editor widget is creating your feature you can't pass any attributes at creation, you need to set up an event monitor for the layer being edited, and then when that occurs create the attribute for the feature and save it using Apply Edits.&lt;/P&gt;&lt;P&gt;Maybe something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;aLayer.on("apply-edits", function (results) {
    
    if (results.edits.addFeatures) {
        var newObjectId = results.addFeatureResults[0]["objectId"]; 
        console.log("Added new feature with objectID: ", newObjectId);
        var edit = [{"id" : 0, 
            "updates": [
                "attributes": {
                  "OBJECTID": newObjectId,
                  "datetime": 1272210710000,
                  "Somefield": "This is an updated value" 
                } 
            ]
        }]
        var promise = aLayer.applyEdits(edit);
        console.log(promise);
    }
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Oct 2022 16:02:30 GMT</pubDate>
    <dc:creator>JeffreyWilkerson</dc:creator>
    <dc:date>2022-10-31T16:02:30Z</dc:date>
    <item>
      <title>Hi I want to create a feature from the Editor widget and when its created i want to apply the value in the back end which needs to updated on the attr</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hi-i-want-to-create-a-feature-from-the-editor/m-p/1227002#M79173</link>
      <description />
      <pubDate>Mon, 31 Oct 2022 11:49:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hi-i-want-to-create-a-feature-from-the-editor/m-p/1227002#M79173</guid>
      <dc:creator>PalaniSwamy</dc:creator>
      <dc:date>2022-10-31T11:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Hi I want to create a feature from the Editor widget and when its created i want to apply the value in the back end which needs to updated on the</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hi-i-want-to-create-a-feature-from-the-editor/m-p/1227078#M79177</link>
      <description>&lt;P&gt;Since the Editor widget is creating your feature you can't pass any attributes at creation, you need to set up an event monitor for the layer being edited, and then when that occurs create the attribute for the feature and save it using Apply Edits.&lt;/P&gt;&lt;P&gt;Maybe something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;aLayer.on("apply-edits", function (results) {
    
    if (results.edits.addFeatures) {
        var newObjectId = results.addFeatureResults[0]["objectId"]; 
        console.log("Added new feature with objectID: ", newObjectId);
        var edit = [{"id" : 0, 
            "updates": [
                "attributes": {
                  "OBJECTID": newObjectId,
                  "datetime": 1272210710000,
                  "Somefield": "This is an updated value" 
                } 
            ]
        }]
        var promise = aLayer.applyEdits(edit);
        console.log(promise);
    }
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Oct 2022 16:02:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hi-i-want-to-create-a-feature-from-the-editor/m-p/1227078#M79177</guid>
      <dc:creator>JeffreyWilkerson</dc:creator>
      <dc:date>2022-10-31T16:02:30Z</dc:date>
    </item>
  </channel>
</rss>

