find

AMD: require(["esri/rest/find"], (find) => { /* code goes here */ });
ESM: import * as find from "@arcgis/core/rest/find.js";
Function: esri/rest/find
Since: ArcGIS Maps SDK for JavaScript 4.19

Search a map service exposed by the ArcGIS Server REST API based on a string value. The search can be conducted on a single field of a single layer, on many fields of a layer, or on many fields of many layers.

Use FindParameters to set the parameters of the method. The result will be an instance of FindResult.

Known Limitations

The find operation is currently not supported if attempting to be used:

Method Overview

Name Return Type Summary Function
Promise<object>

Sends a request to the ArcGIS REST map service resource to perform a search based on the input params.

find

Method Details

find

Method
find(url, params, requestOptions){Promise<object>}

Sends a request to the ArcGIS REST map service resource to perform a search based on the input params.

Parameters
url String

URL to the ArcGIS Server REST resource that represents a map service.

Autocasts from Object

Specifies the layers and fields that are used for the search.

requestOptions Object
optional

Additional options to be used for the data request.

Returns
Type Description
Promise<object> Resolves to an object with the following properties:
Property Type Description
results FindResult[] An array of objects containing the result features of the find() method.
exceededTransferLimit Boolean exceededTransferLimit is included in the response only if the result exceeded the transfer limit.
Example
let params = new FindParameters({
  layerIds: [0],
  searchFields: ["areaname"],
  outSpatialReference: { wkid: 4326 },
  returnGeometry: true
});
find(url, params).then(function(results){
  // Results contain FindResults of search
});

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.