<?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: Query Feature Service - Multiple Attribute Fields using one keyword in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/query-feature-service-multiple-attribute-fields/m-p/642341#M4352</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I like how you turned the user input into a variable. Thanks for the help with the structure of the query! This works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Apr 2018 15:05:38 GMT</pubDate>
    <dc:creator>JeffWilcox1</dc:creator>
    <dc:date>2018-04-27T15:05:38Z</dc:date>
    <item>
      <title>Query Feature Service - Multiple Attribute Fields using one keyword</title>
      <link>https://community.esri.com/t5/developers-questions/query-feature-service-multiple-attribute-fields/m-p/642339#M4350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone, I&amp;nbsp;adapted this sample from ESRI staff to search a Feature Service for ONE attribute, but I have not been able to figure out how to have it search multiple fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://jsbin.com/veyaqa/edit?html,output" title="http://jsbin.com/veyaqa/edit?html,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I referenced the following resource, to try to query multiple attribute fields with no success, even though AND/OR seems like a viable option for .where&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm" title="https://developers.arcgis.com/rest/services-reference/query-feature-service-layer-.htm"&gt;Query (Feature Service/Layer)—ArcGIS REST API: Services Directory | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&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 = "Barcode LIKE '%" + document.getElementById("inputTxt").value + "%'";&lt;BR /&gt; layer.queryFeatures(queryParams).then(showResults);&lt;BR /&gt; }&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Any suggestions to search multiple feature service fields for one keyword?&lt;/P&gt;&lt;P&gt;I'm fresh to JavaScript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2018 22:17:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/query-feature-service-multiple-attribute-fields/m-p/642339#M4350</guid>
      <dc:creator>JeffWilcox1</dc:creator>
      <dc:date>2018-04-26T22:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Query Feature Service - Multiple Attribute Fields using one keyword</title>
      <link>https://community.esri.com/t5/developers-questions/query-feature-service-multiple-attribute-fields/m-p/642340#M4351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An OR operator should work.&amp;nbsp; I usually navigate to the rest service URL and execute the query there to be sure it's working successfully.&amp;nbsp; Below is an example that I believe should work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;val &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
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;"Barcode LIKE '%"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; val &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"%' OR NewField LIKE '%"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; val &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>Sun, 12 Dec 2021 03:17:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/query-feature-service-multiple-attribute-fields/m-p/642340#M4351</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T03:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Query Feature Service - Multiple Attribute Fields using one keyword</title>
      <link>https://community.esri.com/t5/developers-questions/query-feature-service-multiple-attribute-fields/m-p/642341#M4352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I like how you turned the user input into a variable. Thanks for the help with the structure of the query! This works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 15:05:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/query-feature-service-multiple-attribute-fields/m-p/642341#M4352</guid>
      <dc:creator>JeffWilcox1</dc:creator>
      <dc:date>2018-04-27T15:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: Query Feature Service - Multiple Attribute Fields using one keyword</title>
      <link>https://community.esri.com/t5/developers-questions/query-feature-service-multiple-attribute-fields/m-p/642342#M4353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, I originally did not and felt like my head was going to explode trying to keep track of all the quotations &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/laugh.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 15:20:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/query-feature-service-multiple-attribute-fields/m-p/642342#M4353</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2018-04-27T15:20:17Z</dc:date>
    </item>
  </channel>
</rss>

