English

FAQ: Is it possible to search for multiple fields per layer using the Search widget in Web AppBuilder for ArcGIS?

Question

Is it possible to search for multiple fields per layer using the Search widget in Web AppBuilder for ArcGIS?

Answer

When using the Search widget in Web AppBuilder for ArcGIS in ArcGIS Online, users may want the widget to display multiple fields or attributes per layer rather than one at a time. However, the Search widget only displays one field per layer in ArcGIS Online. As a workaround, create multiple copies of the desired feature layer according to the number of fields required. To do so, follow the instructions described below:

  1. In ArcGIS Online, navigate to the desired feature layer, make multiple copies and save the copied feature layers. Refer to ArcGIS Online: Copy and save layers for steps to do this.
  2. Navigate to Content > My Content, and click the web map with the desired feature layer.
  3. Click the Settings tab and select the Web Map option. Under Application Settings, check the By Layer check box.
By Layer text box
  1. Click Add Layer and add all the copied layers with the desired fields to be displayed by the Search widget. Click Save.
Note:
The fields must contain strings or integers to make the search easier, and Integer fields only support the Equals condition. For more information, refer to ArcGIS Online: Configure feature search.
Add Layer option
  1. Navigate to Content > My Content and click the desired Web AppBuilder for ArcGIS app.
  2. In the Overview tab, click Edit Application. When the app is opened, under Widget, navigate to the Search widget and click the Configure this widget icon.
Configure this widget icon
  1. In the Configure Search dialog box, click Add search source > Feature layer.
Feature Layer option
  1. In the Set layer source dialog box, select Map and select one of the copied feature layers. Click OK.
Select one of the feature layers
  1. Back in the Configure Search dialog box:
    1. Change the name of the feature layer to a desired name.
    2. Set the Search fields and Display field to the desired field and click OK.
Configure Search dialog box
  1. Click the Save icon to save the changes made.
  2. Repeat steps 6 through 10 for the remaining fields.
  3. When using the Search widget, click the Search widget icon and click the drop-down. Select the desired layer and search based on the field set for the layer. The features from the search result is shown on the map.
Usage of Search widget
End result

Related Information