<?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 Featureset feature attributes no longer serialized in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featureset-feature-attributes-no-longer-serialized/m-p/621550#M16000</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;We were using the following code to add attributes to a feature in a featureset and then pass it as a parameter to a GP tool.&amp;nbsp; This worked in version 2.2 of the API.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//g is loaded from a layer elsewhere and has several valid attributes
FSet = new FeatureSet();
g.Attributes.Add("BaseElev", 1234);
FSet.Features.Add(g);
parameters.Add(new GPFeatureRecordSetLayer("BuildingPolygons_Input", FSet));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After upgrading to v3.0 this stopped working.&amp;nbsp; Any attributes that were not originally loaded on the graphic (i.e. manually added attributes) are missing from the JSON used to call the GP tool.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have found &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/39504-FeatureSet.ToJson()-produces-invalid-Json?p=137806&amp;amp;viewfull=1#post137806" rel="nofollow noopener noreferrer" target="_blank"&gt;this post&lt;/A&gt;&lt;SPAN&gt; and fixed the issue using the following code.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;FSet.Fields = new List&amp;lt;Field&amp;gt;();
FSet.Fields.Add(new Field("BaseElev", Field.FieldType.Double, "BaseElev", null, true, true, 0));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Was this change of behaviour intentional?&amp;nbsp; Where was it documented?&amp;nbsp; Have I done the correct thing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks, Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 02:30:05 GMT</pubDate>
    <dc:creator>MatthewPilgrim</dc:creator>
    <dc:date>2021-12-12T02:30:05Z</dc:date>
    <item>
      <title>Featureset feature attributes no longer serialized</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featureset-feature-attributes-no-longer-serialized/m-p/621550#M16000</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;We were using the following code to add attributes to a feature in a featureset and then pass it as a parameter to a GP tool.&amp;nbsp; This worked in version 2.2 of the API.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//g is loaded from a layer elsewhere and has several valid attributes
FSet = new FeatureSet();
g.Attributes.Add("BaseElev", 1234);
FSet.Features.Add(g);
parameters.Add(new GPFeatureRecordSetLayer("BuildingPolygons_Input", FSet));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After upgrading to v3.0 this stopped working.&amp;nbsp; Any attributes that were not originally loaded on the graphic (i.e. manually added attributes) are missing from the JSON used to call the GP tool.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have found &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/39504-FeatureSet.ToJson()-produces-invalid-Json?p=137806&amp;amp;viewfull=1#post137806" rel="nofollow noopener noreferrer" target="_blank"&gt;this post&lt;/A&gt;&lt;SPAN&gt; and fixed the issue using the following code.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;FSet.Fields = new List&amp;lt;Field&amp;gt;();
FSet.Fields.Add(new Field("BaseElev", Field.FieldType.Double, "BaseElev", null, true, true, 0));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Was this change of behaviour intentional?&amp;nbsp; Where was it documented?&amp;nbsp; Have I done the correct thing?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks, Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:30:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/featureset-feature-attributes-no-longer-serialized/m-p/621550#M16000</guid>
      <dc:creator>MatthewPilgrim</dc:creator>
      <dc:date>2021-12-12T02:30:05Z</dc:date>
    </item>
  </channel>
</rss>

