Frequently asked question

Is it possible to use the LIKE parser in a JavaScript query?

Last Published: October 1, 2025
The query.where clause allows any legal SQL WHERE clause operating on the fields in a layer. By using the '=' (equal sign) operator, the clause searches for exact results, in comparison to the LIKE operator that searches for a pattern or results containing part of the specified query request.

The following code snippet demonstrates how the LIKE query is used in an SQL expression:
query.where = "ID LIKE ' '%123%'"
The query searches for IDs containing the value, 123. The code snippet below demonstrates how the WHERE clause is used to produce a similar result, for specific data according to the desired classification:
var input = dom.byId("ID").value 
var inputID = input.toUpperCase(); 
query.where = "ID = '123'"
Note:
It is crucial to set the query object's WHERE clause correctly and use the '=' operator in the query statement to perform an exact match.

Article ID: 000014290

Software:
  • ArcGIS API for JavaScript 4 x
  • ArcGIS API for JavaScript 3 x

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options