<?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 Search query syntax for searching two fields in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231695#M21621</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying to perform a query task that searches two separate fields. The user text input can either be the Name field or a Docket field.&lt;/P&gt;&lt;P&gt;// Executes on each button click&lt;BR /&gt; function doQuery() {&lt;BR /&gt; // Set the search text to the value of the input box&lt;BR /&gt; document.getElementById("inputTxt").value&lt;BR /&gt; queryParams.where = "&lt;SPAN style="color: #ff9900;"&gt;Name like '%" + document.getElementById("inputTxt").value + "%'";&lt;/SPAN&gt;&lt;BR /&gt; layer.queryFeatures(queryParams).then(showResults);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Apr 2018 14:30:39 GMT</pubDate>
    <dc:creator>MeganWirth</dc:creator>
    <dc:date>2018-04-10T14:30:39Z</dc:date>
    <item>
      <title>Search query syntax for searching two fields</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231695#M21621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying to perform a query task that searches two separate fields. The user text input can either be the Name field or a Docket field.&lt;/P&gt;&lt;P&gt;// Executes on each button click&lt;BR /&gt; function doQuery() {&lt;BR /&gt; // Set the search text to the value of the input box&lt;BR /&gt; document.getElementById("inputTxt").value&lt;BR /&gt; queryParams.where = "&lt;SPAN style="color: #ff9900;"&gt;Name like '%" + document.getElementById("inputTxt").value + "%'";&lt;/SPAN&gt;&lt;BR /&gt; layer.queryFeatures(queryParams).then(showResults);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate the help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2018 14:30:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231695#M21621</guid>
      <dc:creator>MeganWirth</dc:creator>
      <dc:date>2018-04-10T14:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Search query syntax for searching two fields</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231696#M21622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;If you are searching the two fields for the same value from the user input then use code like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; userInput &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; document&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;getElementById&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"inputTxt"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;value&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
queryParams&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;where &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Name like '%"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; userInput &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"%' OR Docket like '%"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; userInput &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"%'"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:44:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231696#M21622</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T11:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Search query syntax for searching two fields</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231697#M21623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Robert, I should be more clear. The user will either search by one field or another. So it would be different values.&lt;/P&gt;&lt;P&gt;Example. The user could know the subdivision name or the docket number. Would like them to be able to search by either option.&lt;/P&gt;&lt;P&gt;Name = RNJ or Docket = 1-15-2018&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2018 15:05:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231697#M21623</guid>
      <dc:creator>MeganWirth</dc:creator>
      <dc:date>2018-04-10T15:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Search query syntax for searching two fields</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231698#M21624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So do you have two different user inputs? How do you determine which they are searching for?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2018 15:11:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231698#M21624</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-04-10T15:11:18Z</dc:date>
    </item>
    <item>
      <title>Re: Search query syntax for searching two fields</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231699#M21625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Only one user text input. Im using this example&amp;nbsp;&lt;A href="http://jsbin.com/veyaqa/edit?html,output"&gt;http://jsbin.com/veyaqa/edit?html,output&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As always. Thanks for your time Robert!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2018 15:22:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231699#M21625</guid>
      <dc:creator>MeganWirth</dc:creator>
      <dc:date>2018-04-10T15:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: Search query syntax for searching two fields</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231700#M21626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ryan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Then you will have to add a checkbox, dropdown or something that will distinguish which field they want to search one or you just use the code I posted in my first reply and let it search both fields for the entered value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2018 15:49:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231700#M21626</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2018-04-10T15:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Search query syntax for searching two fields</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231701#M21627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Im an idiot lol. It works perfectly. Thank you Sir!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2018 15:59:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-query-syntax-for-searching-two-fields/m-p/231701#M21627</guid>
      <dc:creator>MeganWirth</dc:creator>
      <dc:date>2018-04-10T15:59:43Z</dc:date>
    </item>
  </channel>
</rss>

