1. Get started

  2.  Welcome
  3.  Get started
  4.  Run as a Windows service
  5.  Build your first app
  6.  Requirements
  7.  Accessibility support
  8.  Development overview
  9.  About release versions
  10.  What's new
  11.  Frequently asked questions
  12. Working with apps

  13.  Home page
  14.  Create or import an app
  15.  Edit and launch an app
  16.  Choose a theme
  17.  Select a map or scene
  18.  Add widgets
  19.  Widgets overview
  20.  Configure app attributes
  21.  Preview apps on smaller screens
  22.  Export as a template
  23.  Edit or preview template
  24.  Use URL parameters
  25.  Upgrade apps
  26. Configure 2D widgets

  27.  About widget
  28.  Add Data widget
  29.  Analysis widget
  30.  Attribute Table widget
  31.  Batch Attribute Editor widget
  32.  Basemap Gallery widget
  33.  Bookmark widget
  34.  Business Analyst widget
  35.  Chart widget
  36.  Controller widget
  37.  Coordinate widget
  38.  Coordinate Conversion widget
  39.  Cost Analysis widget
  40.  Data Aggregation widget
  41.  Directions widget
  42.  Distance and Direction widget
  43.  District Lookup widget
  44.  Draw widget
  45.  Edit widget
  46.  Emergency Response Guide widget
  47.  Extent Navigate widget
  48.  Filter widget
  49.  Full Screen widget
  50.  Geocoder widget
  51.  GeoLookup widget
  52.  Geoprocessing widget
  53.  Grid Overlay widget
  54.  Gridded Reference Graphic widget
  55.  Group Filter widget
  56.  Image Measurement widget
  57.  Home Button widget
  58.  Incident Analysis widget
  59.  Infographic widget
  60.  Info Summary widget
  61.  Layer List widget
  62.  Legend widget
  63.  Measurement widget
  64.  My Location widget
  65.  Near Me widget
  66.  Network Trace widget
  67.  Oblique Viewer widget
  68.  Overview Map widget
  69.  Parcel Drafter widget
  70.  Print widget
  71.  Public Notification widget
  72.  Query widget
  73.  Related Table Charts widget
  74.  Report Feature widget
  75.  Reviewer Dashboard widget
  76.  Scalebar widget
  77.  Screening widget
  78.  Search widget
  79.  Select widget
  80.  Share widget
  81.  Situation Awareness widget
  82.  Smart Editor widget
  83.  Splash widget
  84.  Stream widget
  85.  Suitability Modeler widget
  86.  Summary widget
  87.  Swipe widget
  88.  Threat Analysis widget
  89.  Time Slider widget
  90.  Visibility widget
  91.  Zoom Slider widget
  92. Configure 3D widgets

  93.  3DFx widget
  94.  About widget
  95.  Basemap Gallery widget
  96.  Compass widget
  97.  Coordinate widget
  98.  Daylight widget
  99.  Full Screen widget
  100.  Home Button widget
  101.  Layer List widget
  102.  Legend widget
  103.  Measurement widget
  104.  My Location widget
  105.  Navigate widget
  106.  Search widget
  107.  Share widget
  108.  Slides widget
  109.  Splash widget
  110.  Zoom Slider widget
  111. Widget development

  112.  Get started
  113.  Naming conventions
  114.  In-panel and off-panel widgets
  115.  Deploy your widget
  116.  Required files
  117.  Widget manifest
  118.  Extend BaseWidget
  119.  Required properties
  120.  Define the template
  121.  Configure the Demo widget
  122.  Add i18n support
  123.  Make widgets user-friendly
  124.  Build your first app
  125.  Communication to app container
  126.  Widget properties
  127.  Make widgets responsive
  128.  Communication between widgets
  129.  Dojo dijit
  130.  Make widgets configurable in builder
  131.  Make widgets backward compatible
  132.  Create a controller widget
  133.  Widget life cycle
  134.  Add help for your widget
  135.  Create a feature action in your widget
  136.  Provide and consume data sources in widgets
  137.  Best practices for unit testing
  138. Theme development

  139.  Theme elements
  140.  Create a theme
  141. 3D development

  142.  3D development guide
  143. Sample code

  144.  Create a custom in-panel widget
  145.  Create a ListView widget
  146.  Create a custom widget using the Report dijit
  147.  Create a new theme
  148.  Create a new style for a theme
  149.  Create a new default layout
  150.  Create a nondefault layout
  151.  Create a new panel
  152.  Create a new layout widget
  153.  Create a controller widget
  154.  Create a feature action in your widget
  155.  Send a layer to the Attribute Table widget
  156.  Open multiple widgets simultaneously
  157.  Use other libraries
  158.  Change the URL of ArcGIS API for JavaScript
  159. Deployment

  160.  Deploy your app
  161.  Use proxy
  162.  Web-tier authentication
  163.  Custom widget and theme deployment
  164.  Upgrade custom widgets and themes
  165. Framework reference

  166.  CSS framework
  167.  FeatureActionManager class
  168.  FilterManager class
  169.  LayerInfo class
  170.  LayerInfos class
  171.  LayerNode class
  172.  LayerStructure class
  173.  PanelManager class
  174.  SelectionManager class
  175.  Utils class
  176.  WidgetManager class
  177. dijit

  178.  FeaturelayerChooserFromMap class
  179.  FeaturelayerServiceBrowser class
  180.  FeatureSetChooserForSingleLayer class
  181.  Filter class
  182.  ImageChooser class
  183.  ItemSelector class
  184.  LayerChooserFromMap class
  185.  RendererChooser class
  186.  Report class
  187.  SnapShot class
  188.  SymbolChooser class
  189. JSON reference

  190.  App configuration
  191.  Map configuration
  192.  Widget configuration
  193.  Widget pool configuration
  194.  Widget on-screen configuration
  195.  Panel configuration
  196.  Group configuration
  197.  DataSource configuration
  198.  About
  199.  Analysis
  200.  Attribute Table
  201.  Basemap Gallery
  202.  Bookmark
  203.  Chart
  204.  Coordinate
  205.  Directions
  206.  Draw
  207.  Edit
  208.  Full Screen
  209.  Geocoder
  210.  Geoprocessing
  211.  Controller
  212.  Home Button
  213.  Image Measurement
  214.  Infographic
  215.  Layer List
  216.  Legend
  217.  Loading Page
  218.  Measurement
  219.  My Location
  220.  Near Me
  221.  Oblique Viewer
  222.  Overview Map
  223.  Print
  224.  Query
  225.  Report Feature
  226.  Reviewer Dashboard
  227.  Scalebar
  228.  Search
  229.  Share
  230.  Splash
  231.  Stream
  232.  Swipe
  233.  Time Slider
  234.  Zoom Slider
  235. What's new archive

  236.  What's new in version 2.23
  237.  What's new in version 2.22
  238.  What's new in version 2.21
  239.  What's new in version 2.20
  240.  What's new in version 2.19
  241.  What's new in version 2.18
  242.  What's new in version 2.17
  243.  What's new in version 2.16
  244.  What's new in version 2.15
  245.  What's new in version 2.14
  246.  What's new in version 2.13
  247.  What's new in version 2.12
  248.  What's new in version 2.11
  249.  What's new in version 2.10
  250.  What's new in version 2.9
  251.  What's new in version 2.8
  252.  What's new in version 2.7
  253.  What's new in version 2.6
  254.  What's new in version 2.5
  255.  What's new in version 2.4
  256.  What's new in version 2.3
  257.  What's new in version 2.2
  258.  What's new in version 2.1
  259.  What's new in version 2.0
  260.  What's new in version 1.3
  261.  What's new in version 1.2
  262.  What's new in version 1.1

Query widget

The Query widget allows you to retrieve information from source data by executing a predefined query. Data sources can be one of the following:

The Query widget serves as a query builder during configuration, allowing you to define the query by specifying source data and filters, and displaying fields in query results. Each query works with a single layer. However, you can define multiple queries for a single app, and data layers can be from multiple sources.

Configure the Query widget

This widget can be set to open automatically when an app starts. Hover over the widget and click the Do not open this widget when the app starts button Do not open this widget when the app starts to change the setting to Open this widget automatically when the app starts. (For widgets that you need to add to the app first, you can turn on this option after configuring the widget.)

The following steps describe how to configure a query. Repeat these steps if you need to define multiple queries.

Steps:
  1. Hover over the widget and click the Configure this widget button Configure this widget to open the configuration window.
    NoteNote:

    If you need to add the widget to the app first, click a widget placeholder on the Widget tab. In the Choose Widget window that opens, select the widget and click OK.

  2. Optionally click Change widget icon to replace the default icon for this widget.

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

  3. Click + New query.

    The Set data source window appears. By default, Map is selected, and all feature layers in the current map are listed below it.

    Alternatively, you can select from from your portal or Service URL. In addition to layers, you can query against related tables.

  4. CautionCaution:

    ArcGIS Web AppBuilder, when integrated in ArcGIS Online, supports ArcGIS Server authentication for adding and accessing secure services. For secure services with web-tier authentication, administrators must configure trusted servers that allow ArcGIS Online to automatically pass through credentials. When trusted servers are updated, you need to edit the app and save the updated information accordingly. See ArcGIS Sever web services for more information.

  5. Click the option next to a data source.
  6. Select a layer from the list.
  7. Click OK to close the Set data source window and return to the query configuration window.

    By default, the Info tab is active.

  8. Specify the title and icon for the query task.
  9. Click the Filters tab.
  10. Click Set Set under Query criteria to define a where clause for the query.
    1. Click + Add expression to display the expression builder.

      The filter expression can be a value-based operation or an operation between two fields.

    2. Select a data field, a query expression and provide input data in the text box.

      When you query against date field attributes, and specify the date option for the value, you can pick time of the date optionally by checking Show time. This option allows you to specify the time accuracy for the field to show in the app, if this attribute and its accuracy is applicable.

      NoteNote:

      You must choose a date prior to setting the time.

      You can choose to set the time accuracy at Hour, Minute or Second level. For example, if you pre-set Hour and Minute values but leave Second blank, at run time you will not see values of second from selection and not be allowed to enter them either, even if the layer contains second-level attributes. If you check the Show Time checkbox, but leave all three text boxes of Hour, Minute and Second blank, at runtime you will not see the option to specific time.

      You have the following options to Set Input Type using the Set button Set:

      • Value—This filter is based on a specific value. You can either set a predefined value or interactively ask the end user for a new value by checking Ask for values. When Ask for values is enabled, provide information about the value in the Prompt field and a hint in the Hint field. This will help the end user enter their query values.
      • Field—Compare the value in one field with the value in another field.
      • Unique—This filter is based on a list of the unique values for the selected field in the layer. It is often used in conjunction with Ask for values so the end user can interactively select a value from a list, which can be a set of all unique values or a set of dynamic unique values based on the previous expressions or on all other expressions regardless of their order. When Ask for values is enabled, provide information about the value in the Prompt field and a hint in the Hint field, and select how the values are listed.
      • Unique (predefined)—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 of their order.

        CautionCaution:
        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.

        CautionCaution:
        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.

      • Multiple—Filter on multiple values in the field and retrieve a dynamic list of values from the layer.
      • Multiple (predefined)—Predefine a static list of values.
        NoteNote:

        Only the is any of and is none of operators support multiple values.

      NoteNote:

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

    3. Use + Add set to add an expression set, which allows you to define and apply two filters to a single query. If All or Any of the expressions in this set are true, records meeting all the expressions or records meeting any of the expressions in the set are returned as results.
    4. Click OK to close the dialog box.
  11. Optionally check Display SQL expression for end users to show the SQL expression on the widget.
  12. The Spatial filters section allows you to choose which spatial filters will be available to end users. Check one or more of the following filters and set one of them as the default by clicking Make default:
    • Only return features within current map extent—Return features within the current map extent.
    • Only return features that intersect with the shape drawn on the map—Click the icons to choose drawing tools shown on the widget. Optionally check Enable buffer option to add a buffer setting for end users.
    • Only return features that have a spatial relationship with features in another layer—Click Set Set to choose spatial relationship rules from Set Spatial Relationships. You can specify a user friendly label for each relationship by double-clicking the label field. Optionally check Enable buffer option to add a buffer setting for end users. The following spatial relationships are supported:
      • Intersect—Part of a feature from layer 1 is contained in a feature from layer 2.
      • Contain—Part or all of a feature from layer 1 completely contains the feature from layer 2.
      • Cross—The feature from layer 1 crosses a feature from layer 2.
      • Envelope intersect—The envelope of layer 1 intersects with the envelope of layer 2.
      • Index intersect—The envelope of the query layer intersects the index entry for the target layer.
      • Overlap—Features from layer 1 overlap features in layer 2.
      • Touch—The feature from layer 1 touches the border of a feature from layer 2.
      • Within—The feature from layer 1 is completely enclosed by the feature from layer 2.
    • Return features within full extent of the map—Return features within the full extent of the map.
    NoteNote:
    Uncheck all the options if you don't want to apply a spatial filter to the query.
  13. Click the Results tab to configure the displayed content and symbol for the query results.
  14. Optionally check Use layer's pop-up configuration in the web map to show the same content defined by the layer’s pop-up configuration in the web map.
  15. Optionally check Configure custom content to show the custom content.
    1. Click the add icon next to the Title of each result item text box.

      The list of fields in the layer displays. You can select fields one at a time. Values from the selected field display in the text box and are used as the query results title. Repeat this step to add additional fields. When multiple fields are added, the concatenation of field values are used as the result title.

    2. Click the pencil icon next to the These field attributes will display text box to open the Set Display Fields dialog box. Check the fields you want to display in the results. For individual fields, the Special Type column allows them to display an image. You can also click the up and down arrows in the Actions column to adjust the field order.
  16. Click the pencil icon next to Sort result items to configure the fields used to sort the query result.

    The services must support pagination or sort on the query result.

  17. Optionally select the Use symbols defined by the layer option to use the layer’s default symbol.
  18. Optionally select the Use custom symbol option, and click the symbol icon to set a custom symbol.

    The Preview window appears, allowing you to choose the color and style for the resulting highlighting symbol.

  19. Click anywhere outside of the symbol preview window to close it.
  20. Optionally check Allow to change symbols at runtime to interactively change the symbols for the resultant features at run time.
  21. Click the Options tab to specify whether or not the query results can be exported and how the query task will create layers.
  22. Repeat steps 3 through 20 to add more query tasks.
  23. To reorder the existing query tasks, hover over the task and click the up and down arrows.
  24. Optionally select Turn off query result layers when the widget is closed and customize Tab labels.
  25. Click OK to save and close the Query window.

Use the Query widget

The following steps explain how to use the Query widget:

Steps:
  1. Click the Query widget to open it. A list of queries is shown on the Tasks tab if you have configured more than one query.
    List of queries

    If the widget has only one query, and it does not ask for input from end users, clicking the widget will run the query and immediately display the results.

    if the widget has only one query, and it asks for input from end users, clicking the widget will display the query with user inputs.

    NoteNote:

    The input from end users can include attribute criteria, one or many spatial filters, or a combination of both.

  2. Click one of the queries. The query may execute differently depending on your configuration.
    1. If the query does not ask for input, the result is shown on the Results tab, and the resulting features display on the map with the symbol you specified during the configuration.
    2. If Ask for values is checked in the configuration, a text box displays prompting you for a new value for the parameter. The default value initially shows in the box. If unique values are set, the text box will list them all.

      NoteNote:
      When querying against date field attributes, if the time picker is configured, you can choose pre-set time values from the drop-down, or you can modify them by tying in the box.

    3. You can use one or more spatial filters.
      • Only return features within current map extent—Return features within the current map extent.
      • Only return features that intersect with the shape drawn on the map—A set of drawing tools can be used to draw shapes on the map to define the area. Optionally, a search distance can be applied to the shapes.
        Draw on the map
      • Only return features that have a spatial relationship with features in another layer—The results are based on the spatial relationship between features in the query layer and features in the related layer. Optionally, a search distance can be applied to the geometries of the features in the related layer.
        Has spatial relationship with features in another layer
      • Return features within full extent of the map—Return features within the full extent of the map.
    4. Click Apply to run the query.

      Features resulting from the query are highlighted on the map with the symbol you specified during the configuration. If the layer has related data, the related records are also included in the results.

  3. In the query results panel:
    • Displayed features—Shows how many results are displayed out of all the results returned. Click the Load more button Load more to load more results for display.
    • Click Expand all Expand all or Collapse all Collapse all to expand/collapse all result details displayed, and Down arrow or Up arrow for individual results.
    • Click the ellipsis button (...) to take actions on the results set as follows:
      • Zoom to
      • Pan to
      • Flash
      • Statistics
      • View in Attribute Table
      • Remove this result
      • Change symbol
    TipTip:

    The maximum number of features a query can return depends on the maxRecordCount property set in the service. The default is 1,000. For example, if you take the default value and expect 1,300 features to return from a query, you will first see 1,000 features in the query result panel. When you scroll down the panel, you will see the remaining 300 features.

    Alternatively, if the query is performed on a related table, all the related features are highlighted on the map and listed in the Query panel.