Skip To Content

Filter widget

The Filter widget allows you to limit the visibility of features in a layer. Only the features that meet the expression criteria will be visible in the map. Accordingly, other out-of-the-box widgets, if applicable, will respond to the change it makes in the layer.

Configure the Filter widget

This widget can be set to open automatically when an app starts. To enable this feature, click the Open this widget automatically when the app starts button Open this widget automatically when the app starts on the widget, which turns it dark green.

  1. Hover over the widget and click the Configure this widget button Configure this widget to open the configuration properties dialog box.
  2. Optionally click Change widget icon and replace it with your own image.

    A file explorer window opens, allowing you to select a local image file to use as the widget icon.

  3. Click + New Filter and select a layer from the Layer drop-down list.
  4. Under the Info tab, name the filter in the Label text box.
  5. Browse to your local images to choose an icon for the filter. The default icon will apply if you don't specify it.
  6. Under the Expressions tab, click + Add expression.
    1. Click the field drop-down arrow and choose the field you want to filter against from the list.
    2. Click the operators drop-down arrow and choose an operator from the list.
      Note:

      Date related value providers now can provide relative dates, such as today, yesterday, and tomorrow. Date related operators, such as in the last and not in the last, can also support the setting of relative dates (e.g., in the last 5 days). Note that certain Date related operators, such as in the last and not in the last, is only available for online hosted feature services.

      Operators is any of and is none of accept multiple values of a field as input. With one of the operators, your expression can get data that matches any/none of the selected values.

    3. If you want to filter based on a specific value, click the setting gear icon, choose Value, and enter a value in the field. Click the box to the left of Ask for values if you want to set up an interactive expression. Enter information about the value in the Prompt field and a hint in the Hint field. Select one or more values from the List values drop-down, to filter the layer with.
    4. If you want to compare the value in one field versus the value in another field, choose Field in the setting, click the drop-down arrow, and choose the field for your expression.
    5. To filter based on a specific value in the field, choose Unique in the settings to retrieve a dynamic list of values from the layer, or choose Unique (predefined) to predefine a static list of values. It also allows you to dynamically show the values based on the previous expressions or all other expressions regardless their orders. Enter information about the value in the Prompt field and a hint in the Hint field, and select how the values are listed.
      Caution:

      Unique value filters require a 10.1 or later map service layer. The Unique option does not appear if you are creating a filter on a 10.0 or earlier service layer.

      Caution:

      To display description for coded values when Values filtered by previous expressions or Values filtered by all other expressions is selected, the service must support the capability of query by statistics.

    6. To filter on multiple values in the field, choose Multiple in the setting to retrieve a dynamic list of values from the layer, or choose Multiple (predefined) to predefine a static list of values. Note that only is any of and is none of operators support multiple values.
    Note:

    If you created an expression based on values or a unique value, you can set up an interactive expression by clicking the box to the left of Ask for values. You cannot ask for values on expressions based on a field.

  7. To create multiple expressions, or one or more sets of expressions, click + Add expression or Add set.

    A set is a grouping of expressions, for example, Shelter capacity is greater than 200 and Status is open.

  8. Under Options tab, check the box left to Remove the preset layer filters from the map if you don't want to carry over the filters in the map to your app.
    1. Optionally check Apply this filter when the widget is opened if you want to apply the filter immediately when the widget is opened.
    2. Optionally check the Collapse the filter expression (if any) when the widget is opened option to collapse the filter with Ask for values.
  9. To add another filter, repeat steps 1 through 8.
    Note:

    When adding multiple filters, you have the option of displaying features that match any or all filters.

  10. Hover over the filter you created in the table to delete or order it.
  11. Optionally select Group filter by layer to sort the filters by the layer they impact.
  12. Optionally, if you want to zoom to features in the layer after the filters are applied, check Zoom to the layer once it's applied filters.
  13. Optionally, if you want end users to create their own filters, check Allow to create custom filters.
  14. Click OK to save and close the configuration.

Use the Filter widget

You can apply multiple filters simultaneously or apply an individual filter to the map.

  1. Click the Filter widget icon to open it.
  2. Click the filter you specify to limit features on the map.

    Notice that toggle button turns on after the filter is applied. Click the filter button again to remove the filtering from the map. You can also turn on and off the toggle button to apply or remove the filter.

  3. Type or choose a value in the text box if Ask for values is checked when the filter is created. Click the filter button to remove the filtering from the map. You may notice the arrow icon next to the filter. Click it to hide the input values.
  4. Click the Create custom filter icon under the bottom-right corner to define your own filters when applicable.