<?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: Experience Builder Query Widget SQL Expression Builder AND with 'contains' not working in ArcGIS Experience Builder Questions</title>
    <link>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-query-widget-sql-expression/m-p/1701006#M23276</link>
    <description>&lt;P&gt;Points for you too because I didn't know I could "&lt;SPAN&gt;open up your browser's dev options to view the internet traffic. From there, you will be able to see the requests that ExB is sending to the server, which includes the query from the query widget." Thank you!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;*oh and also, thank you for saying you would have expected the same behavior if you were to configure it the same way. I thought this was a bug!! apparently it's expected - but not by humans. Lol.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 08 May 2026 20:20:13 GMT</pubDate>
    <dc:creator>AndreaB_</dc:creator>
    <dc:date>2026-05-08T20:20:13Z</dc:date>
    <item>
      <title>Experience Builder Query Widget SQL Expression Builder AND with 'contains' not working</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-query-widget-sql-expression/m-p/1700993#M23272</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;Has anyone had this problem?&lt;/P&gt;&lt;P&gt;I have 2 clauses in my SQL Expression Builder in the Query Widget. The user can pick multiple counties and then they can pick multiple Eras. I am using "is any of" for the county list and "contains" for the Era list. The AND is highlighted so I understand this to mean I should get this SQL Query, when using the example of the County as Milwaukee and the Era as 19th Century or 20th Century:&amp;nbsp;&lt;/P&gt;&lt;P&gt;County = 'Milwaukee' And (Era LIKE '%19th Century%' Or Era LIKE '%20th Century%')&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AndreaB__1-1778267928088.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152225iF50FF8C105A0169C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AndreaB__1-1778267928088.png" alt="AndreaB__1-1778267928088.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AndreaB__2-1778268096149.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152226iBAE3D57B090D8A4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AndreaB__2-1778268096149.png" alt="AndreaB__2-1778268096149.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AndreaB__3-1778268119169.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152227i62C4B79951DF32C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AndreaB__3-1778268119169.png" alt="AndreaB__3-1778268119169.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that right so far? I'll admit this SQL Expression Builder has been very confusing.&lt;/P&gt;&lt;P&gt;So when I run this in ArcGIS Pro, I get 60 records. And when I run it in Experience Builder I get 331. In Experience Builder it is giving me all Counties, not just Milwaukee County. I can't replicate this in ArcGIS Pro - i.e. I can't find a SQL query that gives me 331 results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone explain this? What is the SQL query that Experience Builder is running?&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;**Edit - uh oh, and if I change my SQL Expression Builder to start with Era and have County second:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AndreaB__0-1778268795297.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152228i2A1E78D24C603A6F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AndreaB__0-1778268795297.png" alt="AndreaB__0-1778268795297.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then I get 438 results in ExpB using the same data -&amp;nbsp;Era as 19th Century or 20th Century and county as Milwaukee.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2026 19:34:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-query-widget-sql-expression/m-p/1700993#M23272</guid>
      <dc:creator>AndreaB_</dc:creator>
      <dc:date>2026-05-08T19:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Experience Builder Query Widget SQL Expression Builder AND with 'contains' not working</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-query-widget-sql-expression/m-p/1700996#M23273</link>
      <description>&lt;P&gt;I think the issue is operator grouping/precedence.&lt;/P&gt;&lt;P&gt;The query you want is:&lt;BR /&gt;County = 'Milwaukee'&lt;BR /&gt;AND (&lt;BR /&gt;Era LIKE '%19th Century%'&lt;BR /&gt;OR Era LIKE '%20th Century%'&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;But the results sound like Experience Builder may be effectively running something closer to:&lt;/P&gt;&lt;P&gt;County = 'Milwaukee'&lt;BR /&gt;AND Era LIKE '%19th Century%'&lt;BR /&gt;OR Era LIKE '%20th Century%'&lt;/P&gt;&lt;P&gt;Since SQL evaluates AND before OR, that would return:&lt;/P&gt;&lt;P&gt;(County = 'Milwaukee' AND Era LIKE '%19th Century%')&lt;BR /&gt;OR Era LIKE '%20th Century%'&lt;/P&gt;&lt;P&gt;That would explain why you’re getting records from all counties.&lt;/P&gt;&lt;P&gt;I would try putting the Era conditions into their own clause set grouped with OR, then combine that whole Era clause set with the County clause using AND.&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2026 19:40:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-query-widget-sql-expression/m-p/1700996#M23273</guid>
      <dc:creator>VenkataKondepati</dc:creator>
      <dc:date>2026-05-08T19:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Experience Builder Query Widget SQL Expression Builder AND with 'contains' not working</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-query-widget-sql-expression/m-p/1701000#M23274</link>
      <description>&lt;P&gt;1000% correct, thank you!!! I could not figure this out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, if I put&amp;nbsp;&lt;SPAN&gt;(County = 'Milwaukee' AND Era LIKE '%19th Century%')&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;OR Era LIKE '%20th Century%' into ArcGIS Pro I get 331 results. so that is what ExpB is doing.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for how to group the clause sets also. This will work. I actually have it slightly more complicated in production because I have another field. But in case this helps anyone here is my final SQL Expression Builder screenshot:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AndreaB__0-1778270248935.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152229i06EFFB5D14DAE0C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AndreaB__0-1778270248935.png" alt="AndreaB__0-1778270248935.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is so hard to figure out. Esri, can you make this easier, please? Documentation, better UI, let us type in the SQL, something? ugh.&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2026 20:01:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-query-widget-sql-expression/m-p/1701000#M23274</guid>
      <dc:creator>AndreaB_</dc:creator>
      <dc:date>2026-05-08T20:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Experience Builder Query Widget SQL Expression Builder AND with 'contains' not working</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-query-widget-sql-expression/m-p/1701003#M23275</link>
      <description>&lt;P&gt;I was curious about this so I tried to replicate your scenario in ExB. I was able to replicate it, and I can provide some insight on the query that ExB is actually using.&lt;/P&gt;&lt;P&gt;First of all, you can validate this yourself by opening your ExB app and opening the query widget. Then, open up your browser's dev options to view the internet traffic. From there, you will be able to see the requests that ExB is sending to the server, which includes the query from the query widget. You might have to click a few of the requests to find the one you're looking for, but you will be able to see the query that ExB is sending.&lt;/P&gt;&lt;P&gt;In your case, it appears that ExB is sending a query you're not expecting. This is the query:&amp;nbsp;(County IN ('Lincoln')) AND (Era LIKE '%19th Century%') OR (Era LIKE '%20th Century%')&lt;/P&gt;&lt;P&gt;Notice that if you select multiple eras, it is treating them separately (putting them in separate parenthesis) vs. the query that you are expecting it to be.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RyanUthoff_0-1778270788428.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152230iDB879616931DB655/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RyanUthoff_0-1778270788428.png" alt="RyanUthoff_0-1778270788428.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="RyanUthoff_1-1778270804924.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/152231i6259169FECE2BD50/image-size/medium?v=v2&amp;amp;px=400" role="button" title="RyanUthoff_1-1778270804924.png" alt="RyanUthoff_1-1778270804924.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So that is the root of the problem and why you're not getting the expected results. I don't know if this is by design or not. Honestly, I would have expected the same behavior you are expecting if I were to configure the SQL Expression Builder the same way you did. In my mind, if a person selects multiple eras, it should put that in one big parenthesis block instead of a parenthesis for each era.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: It looks like someone beat me to the solution lol. And bonus points for them for actually knowing why the problem is happening lol.&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2026 20:13:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-query-widget-sql-expression/m-p/1701003#M23275</guid>
      <dc:creator>RyanUthoff</dc:creator>
      <dc:date>2026-05-08T20:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Experience Builder Query Widget SQL Expression Builder AND with 'contains' not working</title>
      <link>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-query-widget-sql-expression/m-p/1701006#M23276</link>
      <description>&lt;P&gt;Points for you too because I didn't know I could "&lt;SPAN&gt;open up your browser's dev options to view the internet traffic. From there, you will be able to see the requests that ExB is sending to the server, which includes the query from the query widget." Thank you!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;*oh and also, thank you for saying you would have expected the same behavior if you were to configure it the same way. I thought this was a bug!! apparently it's expected - but not by humans. Lol.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 May 2026 20:20:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-experience-builder-questions/experience-builder-query-widget-sql-expression/m-p/1701006#M23276</guid>
      <dc:creator>AndreaB_</dc:creator>
      <dc:date>2026-05-08T20:20:13Z</dc:date>
    </item>
  </channel>
</rss>

