<?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: How to Filter features by multiple attribute? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-features-by-multiple-attribute/m-p/1026756#M71766</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Sorry, I still have a problem in this case, I mean how to do 'where' when I select spring, it will display spring, and when I click spring then I click winter, spring and winter appear.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Feb 2021 03:40:31 GMT</pubDate>
    <dc:creator>ZenBahsin</dc:creator>
    <dc:date>2021-02-15T03:40:31Z</dc:date>
    <item>
      <title>How to Filter features by multiple attribute?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-features-by-multiple-attribute/m-p/1025149#M71711</link>
      <description>&lt;P&gt;Hallo, im newbie about arcgis api js, i want to question, how to filter by multiple attributes, in below im to try use this sample code by arcgis,&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/featurefilter-attributes/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/featurefilter-attributes/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but this sample, just filter by one filter, i want to filter by multiple atributes and show on map, example i want to filter by &lt;STRONG&gt;winter &lt;/STRONG&gt;and &lt;STRONG&gt;spring&lt;/STRONG&gt;&amp;nbsp;and show it together on map, thnks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;

&amp;lt;head&amp;gt;
  &amp;lt;meta charset="utf-8" /&amp;gt;
  &amp;lt;meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /&amp;gt;
  &amp;lt;title&amp;gt;Filter features by attribute | Sample | ArcGIS API for JavaScript 4.18&amp;lt;/title&amp;gt;

  &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.18/esri/themes/light/main.css" /&amp;gt;
  &amp;lt;script src="https://js.arcgis.com/4.18/"&amp;gt;&amp;lt;/script&amp;gt;

  &amp;lt;style&amp;gt;
    html,
    body,
    #viewDiv {
      padding: 0;
      margin: 0;
      height: 100%;
      width: 100%;
    }

    #seasons-filter {
      height: 160px;
      width: 100%;
      visibility: hidden;
    }

    .season-item {
      width: 100%;
      padding: 12px;
      text-align: center;
      vertical-align: baseline;
      cursor: pointer;
      height: 40px;
    }

    .season-item:focus {
      background-color: dimgrey;
    }

    .season-item:hover {
      background-color: dimgrey;
    }

    #titleDiv {
      padding: 10px;
    }

    #titleText {
      font-size: 20pt;
      font-weight: 60;
      padding-bottom: 10px;
    }

  &amp;lt;/style&amp;gt;
  &amp;lt;script&amp;gt;
    require([
      "esri/views/MapView",
      "esri/Map",
      "esri/layers/FeatureLayer",
      "esri/widgets/Expand"
    ], function (
      MapView, Map, FeatureLayer, Expand
    ) {
      let floodLayerView;

      // flash flood warnings layer
      const layer = new FeatureLayer({
        portalItem: {
          id: "f9e348953b3848ec8b69964d5bceae02"
        },
        outFields: ["SEASON"]
      });

      const map = new Map({
        basemap: "gray-vector",
        layers: [layer]
      });

      const view = new MapView({
        map: map,
        container: "viewDiv",
        center: [-98, 40],
        zoom: 4
      });

      const seasonsNodes = document.querySelectorAll(`.season-item`);
      const seasonsElement = document.getElementById("seasons-filter");

      // click event handler for seasons choices
      seasonsElement.addEventListener("click", filterBySeason);

      // User clicked on Winter, Spring, Summer or Fall
      // set an attribute filter on flood warnings layer view
      // to display the warnings issued in that season
      function filterBySeason(event) {
        const selectedSeason = event.target.getAttribute("data-season");
        floodLayerView.filter = {
          where: "Season = '" + selectedSeason + "'"
        };
      }

      view.whenLayerView(layer).then(function (layerView) {
        // flash flood warnings layer loaded
        // get a reference to the flood warnings layerview
        floodLayerView = layerView;

        // set up UI items
        seasonsElement.style.visibility = "visible";
        const seasonsExpand = new Expand({
          view: view,
          content: seasonsElement,
          expandIconClass: "esri-icon-filter",
          group: "top-left"
        });
        //clear the filters when user closes the expand widget
        seasonsExpand.watch("expanded", function () {
          if (!seasonsExpand.expanded) {
            floodLayerView.filter = null;
          }
        });
        view.ui.add(seasonsExpand, "top-left");
        view.ui.add("titleDiv", "top-right");
      });
    });

  &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
  &amp;lt;div id="seasons-filter" class="esri-widget"&amp;gt;
    &amp;lt;div class="season-item visible-season" data-season="Winter"&amp;gt;Winter&amp;lt;/div&amp;gt;
    &amp;lt;div class="season-item visible-season" data-season="Spring"&amp;gt;Spring&amp;lt;/div&amp;gt;
    &amp;lt;div class="season-item visible-season" data-season="Summer"&amp;gt;Summer&amp;lt;/div&amp;gt;
    &amp;lt;div class="season-item visible-season" data-season="Fall"&amp;gt;Fall&amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
  &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
  &amp;lt;div id="titleDiv" class="esri-widget"&amp;gt;
    &amp;lt;div id="titleText"&amp;gt;Flash Floods by Season&amp;lt;/div&amp;gt;
    &amp;lt;div&amp;gt;Flash Flood Warnings (2002 - 2012)&amp;lt;/div&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 05:11:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-features-by-multiple-attribute/m-p/1025149#M71711</guid>
      <dc:creator>ZenBahsin</dc:creator>
      <dc:date>2021-02-10T05:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to Filter features by multiple attribute?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-features-by-multiple-attribute/m-p/1025309#M71718</link>
      <description>&lt;P&gt;The where clause would be&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;where: "Season = 'Winter' or Season = 'Spring'"
or
where: "Season in ('Winter', 'Spring')"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 10 Feb 2021 13:26:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-features-by-multiple-attribute/m-p/1025309#M71718</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-02-10T13:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to Filter features by multiple attribute?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-features-by-multiple-attribute/m-p/1025910#M71737</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/450697"&gt;@ZenBahsin&lt;/a&gt;, if this post answered your question, please click the "Accept as Solution" button&lt;/P&gt;</description>
      <pubDate>Thu, 11 Feb 2021 15:56:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-features-by-multiple-attribute/m-p/1025910#M71737</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-02-11T15:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to Filter features by multiple attribute?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-features-by-multiple-attribute/m-p/1026756#M71766</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Sorry, I still have a problem in this case, I mean how to do 'where' when I select spring, it will display spring, and when I click spring then I click winter, spring and winter appear.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2021 03:40:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-features-by-multiple-attribute/m-p/1026756#M71766</guid>
      <dc:creator>ZenBahsin</dc:creator>
      <dc:date>2021-02-15T03:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to Filter features by multiple attribute?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-features-by-multiple-attribute/m-p/1027159#M71783</link>
      <description>&lt;P&gt;The where clause would look like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;where: "Season = '" + selectedSeason + "' or Season = 'Spring'"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 16 Feb 2021 14:34:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-filter-features-by-multiple-attribute/m-p/1027159#M71783</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-02-16T14:34:44Z</dc:date>
    </item>
  </channel>
</rss>

