<?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: Convert array to Featureset in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/convert-array-to-featureset/m-p/1354815#M56139</link>
    <description>&lt;P&gt;maybe just missing ' ' around fields: [&lt;/P&gt;&lt;P&gt;Any traceback errors etc?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var newDict = {
    'fields': [
        { name: "Use Type", type: "esriFieldTypeString" },
        { name: "Count", type: "esriFieldTypeInteger" },  
    ],
    'geometryType': '',
    'features':NameList&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 29 Nov 2023 19:43:18 GMT</pubDate>
    <dc:creator>DavidPike</dc:creator>
    <dc:date>2023-11-29T19:43:18Z</dc:date>
    <item>
      <title>Convert array to Featureset</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/convert-array-to-featureset/m-p/1354807#M56138</link>
      <description>&lt;P&gt;I have an expression that buffers a line feature and returns a list of intersecting parcel use code descriptions. Currently this outputs an array but I'd like to make it a featureset so I can use groupby to count up the totals for each use type. Everything in the code below works until I get to the dictionary part. Any suggestions?&lt;/P&gt;&lt;P&gt;Here is the dataset being queried:&amp;nbsp;&lt;A href="https://services1.arcgis.com/hGdibHYSPO59RG1h/arcgis/rest/services/L3_TAXPAR_POLY_ASSESS_gdb/FeatureServer/0" target="_self"&gt;https://services1.arcgis.com/hGdibHYSPO59RG1h/arcgis/rest/services/L3_TAXPAR_POLY_ASSESS_gdb/FeatureServer/0&lt;/A&gt;&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;var ParcInt = Intersects(FeatureSetByName($map, "AllParcels",['USE_CODE']), BufferGeodetic($feature, 50, "feet"))
var arr_index = 0;
var NameList = []

var a ="";
for(var x in ParcInt){
  NameList[arr_index] = mid(x.USE_CODE,1,1)
  a =NameList[arr_index];
  NameList[arr_index]=decode(a,
"0","Multi-USe",
"1","Residential",
"2","Open Space",
"3","Commercial",
"4","Industrial",
"5","Personal Property",
"6","Forest Property - Chapter 61",
"7","Agricultural",
"8","Recreational Property",
"9","Exempt Property",
'');
    ++arr_index;;
}
//return namelist

var newDict = {
    fields: [
        { name: "Use Type", type: "esriFieldTypeString" },
        { name: "Count", type: "esriFieldTypeInteger" },  
    ],
    'geometryType': '',
    'features':NameList
};

return FeatureSet(Text(newDict)); &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 19:49:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/convert-array-to-featureset/m-p/1354807#M56138</guid>
      <dc:creator>AustinCanty1</dc:creator>
      <dc:date>2023-11-29T19:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: Convert array to Featureset</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/convert-array-to-featureset/m-p/1354815#M56139</link>
      <description>&lt;P&gt;maybe just missing ' ' around fields: [&lt;/P&gt;&lt;P&gt;Any traceback errors etc?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var newDict = {
    'fields': [
        { name: "Use Type", type: "esriFieldTypeString" },
        { name: "Count", type: "esriFieldTypeInteger" },  
    ],
    'geometryType': '',
    'features':NameList&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 29 Nov 2023 19:43:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/convert-array-to-featureset/m-p/1354815#M56139</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2023-11-29T19:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert array to Featureset</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/convert-array-to-featureset/m-p/1354823#M56140</link>
      <description>&lt;P&gt;I just added a screenshot. It's returning nulls in the featureset. I don't think I'm loading the data into the featureset correctly.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2023 19:51:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/convert-array-to-featureset/m-p/1354823#M56140</guid>
      <dc:creator>AustinCanty1</dc:creator>
      <dc:date>2023-11-29T19:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Convert array to Featureset</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/convert-array-to-featureset/m-p/1354886#M56144</link>
      <description>&lt;LI-CODE lang="javascript"&gt;var ParcInt = Intersects(FeatureSetByName($map, "AllParcels",['USE_CODE']), BufferGeodetic($feature, 50, "feet"))
var arr_index = 0;
var features = [];
var feat;

for(var x in ParcInt){
  useCode = mid(x.USE_CODE,1,1)
  useCode = decode(useCode,
"0","Multi-USe",
"1","Residential",
"2","Open Space",
"3","Commercial",
"4","Industrial",
"5","Personal Property",
"6","Forest Property - Chapter 61",
"7","Agricultural",
"8","Recreational Property",
"9","Exempt Property",
'');

  feat = { 
    'attributes': { 
      'UseType': useCode,   
   }
  };
  Push(features, feat);
}

var newDict = {
    'fields': [
        { name: "UseType", type: "esriFieldTypeString" }  
    ],
    'geometryType': '',
    'features':features
};

return FeatureSet(Text(newDict)); &lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 29 Nov 2023 21:15:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/convert-array-to-featureset/m-p/1354886#M56144</guid>
      <dc:creator>DavidPike</dc:creator>
      <dc:date>2023-11-29T21:15:58Z</dc:date>
    </item>
  </channel>
</rss>

