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:
- 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.
- Navigate to Content > My Content, and click the web map with the desired feature layer.
- Click the Settings tab and select the Web Map option. Under Application Settings, check the By Layer check box.
- Click Add Layer and add all the copied layers with the desired fields to be displayed by the Search widget. Click Save.
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.
- Navigate to Content > My Content and click the desired Web AppBuilder for ArcGIS app.
- 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.
- In the Configure Search dialog box, click Add search source > Feature layer.
- In the Set layer source dialog box, select Map and select one of the copied feature layers. Click OK.
- Back in the Configure Search dialog box:
- Change the name of the feature layer to a desired name.
- Set the Search fields and Display field to the desired field and click OK.
- Click the Save icon to save the changes made.
- Repeat steps 6 through 10 for the remaining fields.
- 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.