<?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 Storing values from multiple select into definition expression in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/storing-values-from-multiple-select-into/m-p/1252385#M80074</link>
    <description>&lt;P&gt;So I have a multiple-select option and I was wondering how do I retrieve the values from the multi-select and assign it to the following layer expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;map.allLayers.forEach((layer) =&amp;gt; {
     layer.definitionExpression = "CSDNAME IN";
     layer.queryExtent().then(function (results) {
	       view.goTo(results.extent);
     });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2023 15:53:39 GMT</pubDate>
    <dc:creator>TheGamer</dc:creator>
    <dc:date>2023-01-27T15:53:39Z</dc:date>
    <item>
      <title>Storing values from multiple select into definition expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/storing-values-from-multiple-select-into/m-p/1252385#M80074</link>
      <description>&lt;P&gt;So I have a multiple-select option and I was wondering how do I retrieve the values from the multi-select and assign it to the following layer expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;map.allLayers.forEach((layer) =&amp;gt; {
     layer.definitionExpression = "CSDNAME IN";
     layer.queryExtent().then(function (results) {
	       view.goTo(results.extent);
     });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 15:53:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/storing-values-from-multiple-select-into/m-p/1252385#M80074</guid>
      <dc:creator>TheGamer</dc:creator>
      <dc:date>2023-01-27T15:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Storing values from multiple select into definition expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/storing-values-from-multiple-select-into/m-p/1252401#M80075</link>
      <description>&lt;P&gt;You can get the values from the multi-select and turn them into a string, which would be then used in the definition expression&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const options = document.getElementById('your-multi-select').selectedOptions;
const values = Array.from(options).map(({ value }) =&amp;gt; "'" + value + "'");
//if the values are numbers, omit the quotes
//const values = Array.from(options).map(({ value }) =&amp;gt; value);
const output = values.join();

layer.definitionExpression = "CSDNAME IN (" + output + ")";&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 27 Jan 2023 16:24:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/storing-values-from-multiple-select-into/m-p/1252401#M80075</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2023-01-27T16:24:09Z</dc:date>
    </item>
  </channel>
</rss>

