Why is it so hard to apply interactive filters in AGOL?

9805
23
09-25-2017 06:00 AM
GeorginaCutler
New Contributor II

All i want to do is create some basic interactive filters in arcgis online that feed through into a web mapping application. I have a dataset with various attributes of text, numerical, and date fields and all i want to do is provide a drop down box for the user to be able to filter on them. Is there a max number of data types that shouldnt be exceeded? I have search the forums and all i get is a long winded way of creating domains and subtypes in catalog or loading in various scripts.  It should be a lot more simple than that surely? I have a good dataset of attributes (that I'm not going to type in manually in a domain). The hope is that the user in the web map can chose to filter on Stage, date completed and client using the drop down boxes based on the data that is in there. EsriCommunity-esristaff

Many thanks, Georgina

23 Replies
XanderBakker
Esri Esteemed Contributor

I suppose you are defining the filters in the web map and you will consume the web map in some web app. Would it be possible to use the Web AppBuilder to configure the web application? If so, WAB has a filter widget that is very easy to configure: Filter widget—Web AppBuilder for ArcGIS | ArcGIS 

MelissaPrindiville
New Contributor III

Is there anyway to use the Filter widget and select multiple filters as an OR versus AND. Like a list of filters for tree types and I want to see one type or i want to select two by checking the box.

0 Kudos
DerekLaw
Esri Esteemed Contributor

Hi Melissa,

You can define multiple filter expressions in the Filter widget, when the first one is applied, the following filters will then work on the subset returned from the first filter.

Hope this helps,

MelissaPrindiville
New Contributor III

Hi Derek, in your example if I understand it correctly filters a subset of the previous filter so like if I had a layer for trees and I filtered on "Maples"  I could then filter the Reds, Sugar etc. 

But what I want to do is filter by Maples and\or Pines.  I  imaged I could create 2 filters and when I selected one filter it would show me Maples if I select Pines filter it would show me pines but if I selected both the maples and the pines filters I would get both.  I am guessing maybe the filter widget is not the correct widget to use for this type of functionality. -Melissa

0 Kudos
XanderBakker
Esri Esteemed Contributor

It would be great additional feature to have a filter support expressions like TREE IN ('Maples', 'Pines'). Being able to select multiple values and filter on them.

For now you could create a nested filter that contains with the ANY option so in case any of the two filters is true, it should return the features (see example below, both point to the same layer and the result is that the two states are returned).

XanderBakker
Esri Esteemed Contributor

To explain a little more of what is needed to do this, here some additional explanation.  In WAB select the filter widget:

Then Add a New Filter, select the layer (in mi case "Accidentes_QA") and give the filter a title (in my case "Filter accidents"). Very important is to add a set (of filter expressions):

The filter expression will look like this:

  • Not that at the top "Any" is selected (so any of the expressions that test true will yield its results, comparable with using OR)
  • Select the field (i my case "GRAVEDAD (String)")
  • Select that a list of Unique values is presented}
  • Switch the option "Ask for values" on
  • Define the prompt (what the user will see): "Severity is" would be for instance select tree species or something similar
  • Select the option "All unique values of this field"

  • The second field will be the same field (in my case again GRAVEDAD (String)).
  • Unique values
  • Ask for values
  • define the second prompt (add "or" in front of it)
  • select again  "All unique values of this field"

When you use the filter you will see this as initial state:

You can use a single value:

Or specify both values:

MelissaPrindiville
New Contributor III

Gottcha!  The only thing I am not seeing is the Prompt. In the example below I have "Business Sector is"  yet no prompt is seen in the widget?

0 Kudos
XanderBakker
Esri Esteemed Contributor

That is interesting. Can you share a screenshot of the configuration of the widget?

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Melissa Prindiville , I am not seeing the screenshot. 

0 Kudos