<?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: Extracting uniqueValues into an array in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/extracting-uniquevalues-into-an-array/m-p/1252963#M80107</link>
    <description>&lt;LI-CODE lang="javascript"&gt;let layer = new FeatureLayer({
  portalItem: { id: "5ce5374a461e45bab714b43ffedf151d" }
});

uniqueValues({
  layer: layer,
  field: "Candidate"
}).then(function(response){
  
  let infos = response.uniqueValueInfos;
  const values = infos.map((info) =&amp;gt; info.value);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just call Array.map() and return the value in the callback. That will create a new array with only the values.&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2023 16:57:33 GMT</pubDate>
    <dc:creator>KristianEkenes</dc:creator>
    <dc:date>2023-01-30T16:57:33Z</dc:date>
    <item>
      <title>Extracting uniqueValues into an array</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/extracting-uniquevalues-into-an-array/m-p/1252956#M80104</link>
      <description>&lt;LI-CODE lang="javascript"&gt;let layer = new FeatureLayer({
  portalItem: { id: "5ce5374a461e45bab714b43ffedf151d" }
});

uniqueValues({
  layer: layer,
  field: "Candidate"
}).then(function(response){
  // prints each unique value and the count of features containing that value
  let infos = response.uniqueValueInfos;
  infos.forEach(function(info){
    console.log(info.value);
  });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm struggling on how to store the info.value into a new Array&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 16:43:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/extracting-uniquevalues-into-an-array/m-p/1252956#M80104</guid>
      <dc:creator>TheGamer</dc:creator>
      <dc:date>2023-01-30T16:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting uniqueValues into an array</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/extracting-uniquevalues-into-an-array/m-p/1252963#M80107</link>
      <description>&lt;LI-CODE lang="javascript"&gt;let layer = new FeatureLayer({
  portalItem: { id: "5ce5374a461e45bab714b43ffedf151d" }
});

uniqueValues({
  layer: layer,
  field: "Candidate"
}).then(function(response){
  
  let infos = response.uniqueValueInfos;
  const values = infos.map((info) =&amp;gt; info.value);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just call Array.map() and return the value in the callback. That will create a new array with only the values.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 16:57:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/extracting-uniquevalues-into-an-array/m-p/1252963#M80107</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2023-01-30T16:57:33Z</dc:date>
    </item>
  </channel>
</rss>

