Filter by all

1283
5
Jump to solution
03-14-2016 03:33 AM
DarrylHilton
New Contributor III

Hi

I am trying to create a simple application that allows users to filter a layer based on a few attributes, allowing the users to select "any" or "all" if they wish. For example if a layer has attributes of Country, Colour and Age they should be able to search for Country = Any, Colour = "Green" and Age is greater than 50.

However, using the default web appbuilder and arcgisonline tools, as my country has a drop down list (which it would need to avoid typos and to pick from a specified list) it is always making the user select a country so users can never say I want to see all green things over 50 without also saying, for example, in France.

Anyone had this issue before and know a way around it?

Thanks

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Darryl,

  You should look into using the eSearch widget then. The eSearch will add and "all" option for fields that are not configured as required or if there is not a option chosen from the drop down list then that field will not be used in the query (if it is not required).

Enhanced Search Widget Version 1.3.0.2 - 2/24/16

View solution in original post

5 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Darryl,

  You should look into using the eSearch widget then. The eSearch will add and "all" option for fields that are not configured as required or if there is not a option chosen from the drop down list then that field will not be used in the query (if it is not required).

Enhanced Search Widget Version 1.3.0.2 - 2/24/16

View solution in original post

DarrylHilton
New Contributor III

Hi Robert

I had already looked at that and thought it didn't do what I needed. Having played around a little longer it does!

Thanks

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Darryl,

  Glad it works for you. Don't forget to mark my reply as the correct answer.

0 Kudos
DarrylHilton
New Contributor III

If anyone has the specific issue I had and reads this. I used the predefined list, entered all choices and set the Value for an 'Any' option as an underscore '_'.

With a query of FIELD LIKE '[Value]%' this brings back all records so essentially is like un-filtering that layer

DarrylHilton
New Contributor III

Hi Robert

One thing, do you know if it is possible to not have this section, I only have one searchable layer and want every selection to be a new one so don;t really need any of that. As this will be seen by members of the public I like to try and make the interface have as few options as poissible. I have tried marking various divs in the code as visibility: hidden or display: none but has no affect

EDIT: Ignore this, I have worked it out