<?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: Setting an attribute value on feature creation in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395269#M36464</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nice solution, but things still aren't working for me. According to the edit callback, everything is working just fine; attributes are being sent to the server, and the 'success' field in the 'addResults' object (in the edit callback) is always returns true, BUT the instances being created in my geodatabase never have any attribution set. I've tried updating after the add also, and get the same results. The process reports that everything went smoothly, but the database does not reflect that at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ryan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Jan 2011 16:10:24 GMT</pubDate>
    <dc:creator>RyanTwilley</dc:creator>
    <dc:date>2011-01-26T16:10:24Z</dc:date>
    <item>
      <title>Setting an attribute value on feature creation</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395264#M36459</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;I'm using the template picker to create features from a given template. What I want to be able to do is to automatically set the value of an attribute for that feature. The value of the attribute will only be known at the time it is created.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, the web application I am building receives an id that I need to assign to each feature created.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've had a look through the forums and samples but can't see exactly how to go about this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 03:40:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395264#M36459</guid>
      <dc:creator>mdonnelly</dc:creator>
      <dc:date>2010-11-25T03:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Setting an attribute value on feature creation</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395265#M36460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK, I've managed to push the attribute value into the graphic. However it then doesn't render the graphic that has just been created by the feature template picker. Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var ft0 = new esri.layers.FeatureLayer("http://172.16.25.71/ArcGIS/rest/services/necma_wod2/FeatureServer/0",{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mode: esri.layers.FeatureLayer.MODE_ONDEMAND, 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outFields: ['*']
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
dojo.connect(ft0, "onBeforeApplyEdits", addAttributeValues);
.
.
.
function addAttributeValues (adds, updates, deletes){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (i in adds){
&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; adds&lt;I&gt;.setAttributes({"ARID":arid,});
&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; adds&lt;I&gt;.visible = true;
&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; adds&lt;I&gt;.show();
&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; //alert(adds&lt;I&gt;.getContent());
&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;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:06:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395265#M36460</guid>
      <dc:creator>mdonnelly</dc:creator>
      <dc:date>2021-12-11T18:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Setting an attribute value on feature creation</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395266#M36461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mark,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's a code snippet that worked for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
dojo.connect(layer,"onBeforeApplyEdits",function(adds,updates,deletes){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dojo.forEach(adds,function(add){
&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; add.attributes.symbolid = new Date().getTime().toString();
&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;&amp;nbsp;&amp;nbsp; });
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:06:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395266#M36461</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2021-12-11T18:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Setting an attribute value on feature creation</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395267#M36462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks so much, that worked a charm. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The behaviour of setAttributes is very strange!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Dec 2010 20:27:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395267#M36462</guid>
      <dc:creator>mdonnelly</dc:creator>
      <dc:date>2010-12-01T20:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Setting an attribute value on feature creation</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395268#M36463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i believe that with dojo at least 'setAttribute' is depricated.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jan 2011 23:51:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395268#M36463</guid>
      <dc:creator>timgogl</dc:creator>
      <dc:date>2011-01-18T23:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Setting an attribute value on feature creation</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395269#M36464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nice solution, but things still aren't working for me. According to the edit callback, everything is working just fine; attributes are being sent to the server, and the 'success' field in the 'addResults' object (in the edit callback) is always returns true, BUT the instances being created in my geodatabase never have any attribution set. I've tried updating after the add also, and get the same results. The process reports that everything went smoothly, but the database does not reflect that at all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ryan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jan 2011 16:10:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395269#M36464</guid>
      <dc:creator>RyanTwilley</dc:creator>
      <dc:date>2011-01-26T16:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Setting an attribute value on feature creation</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395270#M36465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So, I had forgotten that I marked the columns that I was trying to set as 'Read-only' in the attribute table in ArcMap before I published the map service. Oops!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Jan 2011 16:59:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setting-an-attribute-value-on-feature-creation/m-p/395270#M36465</guid>
      <dc:creator>RyanTwilley</dc:creator>
      <dc:date>2011-01-26T16:59:17Z</dc:date>
    </item>
  </channel>
</rss>

