<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Valid syntax for &amp;quot;IN&amp;quot; where clause for Query, using a list of county names in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727122#M67457</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tracy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Your users are just typing things like dent,holt right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The the replace would be simple:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14099466829022607 jive_text_macro" jivemacro_uid="_14099466829022607" modifiedtitle="true"&gt;
&lt;P&gt;function checkCountyInput() { &lt;/P&gt;
&lt;P&gt;&amp;nbsp; var countyCheck = registry.byId('countySel').get("value"); &lt;/P&gt;
&lt;P&gt;console.log("countyCheck = " + countyCheck); &lt;/P&gt;
&lt;P&gt;&amp;nbsp; countyCheck.replace(",","','");&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //console.log("countyArray = " + countyArray); &lt;/P&gt;
&lt;P&gt;&amp;nbsp; idList.length = 0; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; countyList.length = 0; &lt;/P&gt;
&lt;P&gt;//the syntax that worked on the REST endpoint &lt;/P&gt;
&lt;P&gt;&amp;nbsp; //COUNTYNAME IN ('Dent', 'Holt') &lt;/P&gt;
&lt;P&gt;&amp;nbsp; var whereClause = "COUNTYNAME IN ('" + countyCheck + "')"; &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; query.outSpatialReference = spatialReference; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; query.returnGeometry = false; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; query.outFields = "*"; &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;console.log("where clause = " + whereClause); &lt;/P&gt;
&lt;P&gt;var queryTask = new QueryTask(featureLayer.url); &lt;/P&gt;
&lt;P&gt;queryTask.on ("error", function (err) { &lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log("error in queryTask: " + err.message); &lt;/P&gt;
&lt;P&gt;}); &lt;/P&gt;
&lt;P&gt;queryTask.execute(query, queryCountyResults); &lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Sep 2014 19:59:01 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2014-09-05T19:59:01Z</dc:date>
    <item>
      <title>Valid syntax for "IN" where clause for Query, using a list of county names</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727119#M67454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at my rest endpoint, I can enter a where clause of COUNTYNAME IN ('Dent', 'Holt').&amp;nbsp; I'd like to let the user enter a list of county names in an input field and parse that information into a where clause for a Query.&amp;nbsp; I assume if I can run a query from the endpoint, I ought to be able to do the same thing programmatically as long as I can get my syntax correct on my where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user has an input text field and they should enter county names separated by commas.&amp;nbsp;&amp;nbsp;&amp;nbsp; Once they click a button, a where clause is created with all the counties specified. The queryTask doesn't execute because my query syntax is wrong. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14099444653941164 jive_text_macro" jivemacro_uid="_14099444653941164"&gt;
&lt;P&gt;function checkCountyInput() {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var countyCheck = registry.byId('countySel').get("value");&lt;/P&gt;
&lt;P&gt; console.log("countyCheck = " + countyCheck);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var countyArray = countyCheck.split(",");&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log("countyArray = " + countyArray);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; idList.length = 0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; countyList.length = 0;&lt;/P&gt;
&lt;P&gt;//the syntax that worked on the REST endpoint&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //COUNTYNAME IN ('Dent', 'Holt') &lt;/P&gt;
&lt;P&gt;&amp;nbsp; var whereClause = "COUNTYNAME IN (" + countyArray + ")";&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; query.outSpatialReference = spatialReference;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; query.returnGeometry = false;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; query.outFields = "*";&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;console.log("where clause = " + whereClause);&lt;/P&gt;
&lt;P&gt;var queryTask = new QueryTask(featureLayer.url);&lt;/P&gt;
&lt;P&gt;queryTask.on ("error", function (err) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log("error in queryTask: " + err.message);&lt;/P&gt;
&lt;P&gt;});&lt;/P&gt;
&lt;P&gt;queryTask.execute(query, queryCountyResults);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;I'm I not going about this the right way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 19:17:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727119#M67454</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2014-09-05T19:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Valid syntax for "IN" where clause for Query, using a list of county names</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727120#M67455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tracy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; It worked in the REST End point because each of the county name was wrapped in single quotes and comma separated. Instead of splitting the string by the comma try replacing the comma with ',' and then make sure the string starts with a single quote and ends with one too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 19:30:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727120#M67455</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-09-05T19:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Valid syntax for "IN" where clause for Query, using a list of county names</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727121#M67456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get what you're saying, but I get lost trying to replace in a string where it needs to escape things like quotes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 19:42:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727121#M67456</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2014-09-05T19:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Valid syntax for "IN" where clause for Query, using a list of county names</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727122#M67457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tracy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Your users are just typing things like dent,holt right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The the replace would be simple:&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14099466829022607 jive_text_macro" jivemacro_uid="_14099466829022607" modifiedtitle="true"&gt;
&lt;P&gt;function checkCountyInput() { &lt;/P&gt;
&lt;P&gt;&amp;nbsp; var countyCheck = registry.byId('countySel').get("value"); &lt;/P&gt;
&lt;P&gt;console.log("countyCheck = " + countyCheck); &lt;/P&gt;
&lt;P&gt;&amp;nbsp; countyCheck.replace(",","','");&lt;/P&gt;
&lt;P&gt;&amp;nbsp; //console.log("countyArray = " + countyArray); &lt;/P&gt;
&lt;P&gt;&amp;nbsp; idList.length = 0; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; countyList.length = 0; &lt;/P&gt;
&lt;P&gt;//the syntax that worked on the REST endpoint &lt;/P&gt;
&lt;P&gt;&amp;nbsp; //COUNTYNAME IN ('Dent', 'Holt') &lt;/P&gt;
&lt;P&gt;&amp;nbsp; var whereClause = "COUNTYNAME IN ('" + countyCheck + "')"; &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; query.outSpatialReference = spatialReference; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; query.returnGeometry = false; &lt;/P&gt;
&lt;P&gt;&amp;nbsp; query.outFields = "*"; &lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;console.log("where clause = " + whereClause); &lt;/P&gt;
&lt;P&gt;var queryTask = new QueryTask(featureLayer.url); &lt;/P&gt;
&lt;P&gt;queryTask.on ("error", function (err) { &lt;/P&gt;
&lt;P&gt;&amp;nbsp; console.log("error in queryTask: " + err.message); &lt;/P&gt;
&lt;P&gt;}); &lt;/P&gt;
&lt;P&gt;queryTask.execute(query, queryCountyResults); &lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 19:59:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727122#M67457</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-09-05T19:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Valid syntax for "IN" where clause for Query, using a list of county names</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727123#M67458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried a join like var countyString = countyCheck.split(', ').join("','"); and my string looks OK.&amp;nbsp; I also tried your way too, again the string looks OK&amp;nbsp; The console log shows whereClause2 = COUNTYNAME IN ('Cole','Dent') , which looks like the REST syntax, so I figured I was good to go. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either method of creating the string, the queryTask is failing though.&amp;nbsp; I'm getting an error:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hasBreakSwitch objectBox-errorMessage objectBox"&gt;&lt;SPAN class="errorMessage"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hasBreakSwitch objectBox-errorMessage objectBox"&gt;&lt;SPAN class="errorMessage"&gt;TypeError: a.toJson is not a function&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="hasBreakSwitch objectBox-errorMessage objectBox"&gt;&lt;SPAN class="errorMessage"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 20:13:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727123#M67458</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2014-09-05T20:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Valid syntax for "IN" where clause for Query, using a list of county names</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727124#M67459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tracy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Isn't the outfields supposed to be an array?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14099486858881983" jivemacro_uid="_14099486858881983"&gt;
&lt;P&gt;query.outfields = ["*"];&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 20:24:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727124#M67459</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-09-05T20:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Valid syntax for "IN" where clause for Query, using a list of county names</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727125#M67460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're right!&amp;nbsp; That didn't fix it, though.&amp;nbsp; I do think I must have an error somewhere else.&amp;nbsp; My queryTask error handler isn't executing, which it normally does when I have a syntax problem on the query. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 20:30:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727125#M67460</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2014-09-05T20:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Valid syntax for "IN" where clause for Query, using a list of county names</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727126#M67461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I must be getting tired.&amp;nbsp; I forgot to set my query.where to my string once I had it all formatted!&amp;nbsp; Now instead of the original type function, I'm getting another one:&amp;nbsp; 'undefined' is not a function. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 20:43:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727126#M67461</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2014-09-05T20:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Valid syntax for "IN" where clause for Query, using a list of county names</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727127#M67462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tracy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Here is a working sample. This sample handles if a user puts spaces between the commas.&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14099507612851468" jivemacro_uid="_14099507612851468"&gt;
&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;html&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;head&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;!--The viewport meta tag is used to improve the presentation and behavior of the samples&amp;nbsp; --&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;title&amp;gt; IN Query&amp;lt;/title&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;script src="//js.arcgis.com/3.10/"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;script&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; require([&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "esri/tasks/query", "esri/tasks/QueryTask", "esri/config",&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "dojo/dom", "dojo/on", "dijit/registry", "dojo/parser", "dijit/form/TextBox", "dojo/domReady!"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ], function (&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Query, QueryTask, esriConfig, dom, on, registry, parser&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parser.parse();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //need to reference a working proxy here, dropbox doesn't allow you to host proxies&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //esri.config.defaults.io.proxyUrl = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://gislap183/Proxy/proxy.ashx" rel="nofollow" target="_blank"&gt;http://gislap183/Proxy/proxy.ashx&lt;/A&gt;&lt;SPAN&gt;";&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //esri.config.defaults.io.alwaysUseProxy = true;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //you can either explicitly include 'http' or 'https' or infer the same protocol as the running application &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on(dom.byId("execute"), "click", checkCountyInput);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function checkCountyInput() {&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var countyCheck = registry.byId('countySel').get("value");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //remove leading and trailing spaces from the array elements&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var uaList = trimArray(countyCheck.split(","));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var uList = uaList.join("','");&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var whereClause = "NAME IN ('" + uList + "')"; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new Query();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.returnGeometry = false;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.outFields = ["*"];&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.where = whereClause;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("where clause = " + whereClause);&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var queryTask = new QueryTask("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2" rel="nofollow" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2&lt;/A&gt;&lt;SPAN&gt;");&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.on ("error", function (err) {&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("error in queryTask: " + err.message);&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; queryTask.execute(query, showResults);&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function showResults(results) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dom.byId("info").innerHTML = "success";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function err(e) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dom.byId("info").innerHTML = e;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function trimArray(arr){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(var i=0;i&amp;lt;arr.length;i++)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arr&lt;I&gt; = arr&lt;I&gt;.replace(/^\s*/, '').replace(/\s*$/, '');&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return arr;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/head&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;body&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;input id="countySel" data-dojo-type="dijit.form.TextBox" type="text" data-dojo-props="trim:true, propercase:true" style="width: 100%"&amp;gt;&amp;lt;input id="execute" type="button" value="run query"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;br /&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;br /&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;div id="info" style="padding:5px; margin:5px; background-color:#eee;"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/body&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 20:59:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727127#M67462</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-09-05T20:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: Valid syntax for "IN" where clause for Query, using a list of county names</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727128#M67463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the end, I changed my error handler for my queryTask not to be as an event listener and it started working.&amp;nbsp; Instead I put it at the end of the queryTask.execute(query, queryCountyResults, errorHandler);&amp;nbsp; I shouldn't have had to do it that way, but it worked.&amp;nbsp;&amp;nbsp; I marked the answer earlier as correct, since it addressed the issue of the post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Sep 2014 21:47:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/valid-syntax-for-quot-in-quot-where-clause-for/m-p/727128#M67463</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2014-09-05T21:47:44Z</dc:date>
    </item>
  </channel>
</rss>

