Most ArcGIS Instant Apps templates support the ability to search locations and features within the app. An integrated search widget in the app's user interface allows a user to input search terms. You can fine-tune the search options so that users of your app can find the most relevant results.
Note:
Some templates do not support search tools. Refer to the app tools matrix (PDF) to see which templates support search tools.
Additionally, some templates support search tools but may display them differently than described in this documentation, such as Public Notification, Nearby, and Zone Lookup.
The sections below outline how to configure the search tool. To refine search results, you can edit available locators, add a custom locator by URL, or add a search source from layers in the map.
Use the search configuration settings
This section explains how to configure your app’s search settings. By default, the ArcGIS World Geocoding Service is the source.
However, if your organization has established locators registered, all established locators specified in the organization settings appear in the search source list.
To open the configuration settings, complete the following steps:
- Click the Interactivity section.
- Click Search to open the Search configuration section.
Within the sources pane, you can see the sources currently active for your app's search widget.
Edit sources
From the search configuration settings, you can rearrange the order of sources as they appear in your app’s search widget. The top source in the list is used as the default source when the app loads. If you have multiple sources, you may want to sort your sources with the most relevant ones to your users at the top.
You can also delete sources, or turn on the All sources toggle button to have your app search against all sources at once.
Search source parameters
There are also a variety of parameters you can configure for each source. Click the options button next to the source in the list and click Edit to access the various parameters for your search source.
The following search source parameters can be configured:
- Locator name—Specify a custom name for the search source.
- Placeholder text—Specify the preset text shown in the search box before a search value is typed. Think of this as hint text.
- Zoom Scale—Choose a scale that the search result will zoom to.
- Enable suggestions—If you check this box, potential matches will appear in a menu as a search value is entered.
- Maximum suggested characters—Set how many characters need to be entered to generate a search result. Default is 3. Integer fields require an exact match.
- Maximum suggestions—Control the total number of suggestions. It is recommended that you keep this number under 5.
- Maximum results—Set the maximum amount of results that will be returned.
- Constrain search within map—Check this box to only find features that are within the extent of the map. This is the extent saved at the web map level.
- Country code(s)—You can enter an official ISO 3166 code for a country or zone. This may be helpful if your search returns overlapping candidates from multiple countries or zones and you want to configure your results to prioritize a specific country or zone. You can add multiple codes.
To find country codes, you can browse ISO’s Online Browsing Platform.
Refine search results
The following sections outline further options for refining search results.
Add a locator search source
You can customize your own locator and add it to your app as a search source. Customizing your own locator allows more precision in search results. You can filter the types of locations that will appear, the regions and areas to conduct the search within, and even the preference for returning street names.
To add a custom locator, complete the following steps:
- In the Search configuration settings, click Add a source.
- In the Search source section, select Locator.
- In the Set up source drop-down menu, select From URL.
- Enter your locator's URL.
Note:
This can be found in your locator’s content overview. You can generate a short URL to link to an item page.
- Click Add source.
The Edit menu appears.
- Optionally, on the Edit menu, change the parameters.
- Click Done.
Add a layer search source
You can add additional search sources other than locators. You can use the layers in your map as a search source or reference layers from a URL that are not in the map to use as a source. This allows your app users to search for a specific feature based on an attribute value.
Note:
If you add a layer search source, only layer search results will be returned in the search tool.
To configure feature search in your app, complete the following steps:
- In the Search configuration settings, click Add a source.
- In the Search source section, select Layer.
- On the Set up source drop-down menu, select Map.
- Click the feature layer you want to set as a search source.
- Under Add search field, click the search field you want to use for the layer source.
Note:
Select at least one field. You can select more fields later.
- Click Add source.
The Edit menu appears.
- Configure the Display field value, which determines what field will populate the search results.
If you want to use multiple search fields, you can select additional fields on the Search fields drop-down menu.
- Make any additional changes and configure any additional options.
- Click Done.
Now, when the search tool finds the feature, the feature is highlighted in the map and automatically opens a pop-up with details about it.