<?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: setDefinitionExpression and LIKE operator and wildcard % issues in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setdefinitionexpression-and-like-operator-and/m-p/555945#M51867</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still think this is an issue however I did find a workaround for what I am doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replace any % wildcards with its &lt;SPAN style="color: #545454; font-family: arial, sans-serif; font-size: small;"&gt;hexadecimal encoding %25&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g. replace misbehaving expressions such as &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;myField LIKE '%Ca%' &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;myField LIKE '%25Ca%25'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works well for me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Sep 2014 00:37:20 GMT</pubDate>
    <dc:creator>GustafJonsson</dc:creator>
    <dc:date>2014-09-25T00:37:20Z</dc:date>
    <item>
      <title>setDefinitionExpression and LIKE operator and wildcard % issues</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setdefinitionexpression-and-like-operator-and/m-p/555944#M51866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the &lt;STRONG&gt;setDefinitionExpression&lt;/STRONG&gt; on some of my FeatureLayers. This works fine in most cases but I believe there might be a bug in the API when it comes to the LIKE operator and the % wildcard. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using expressions such as; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;myField LIKE '%Ca%'&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I get no results even though "myField"&amp;nbsp; has several records including the word "Catchment"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;however I always get correct results when just using a single character between the % wildcards, such as&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;myField LIKE '%C%'&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;myField LIKE '%a%'&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;interestingly, it does sometimes work as expected with multiple characters (depends on the character combination), e.g. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;myField LIKE '%tr%'&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;works fine and returns the correct features&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;I suspect this may be a bug in the API since the &lt;/SPAN&gt;&lt;STRONG style="line-height: 1.5;"&gt;getDefinitionExpression&lt;/STRONG&gt;&lt;SPAN style="line-height: 1.5;"&gt; always returns the expression exactly as I stated it. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In essence, it appears to be a parsing issue with %xx in the definition expressions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;I'm on version 3.10 now and I am pretty sure this was not an issue in 3.8.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone else had this issue?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Sep 2014 23:19:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setdefinitionexpression-and-like-operator-and/m-p/555944#M51866</guid>
      <dc:creator>GustafJonsson</dc:creator>
      <dc:date>2014-09-24T23:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: setDefinitionExpression and LIKE operator and wildcard % issues</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setdefinitionexpression-and-like-operator-and/m-p/555945#M51867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I still think this is an issue however I did find a workaround for what I am doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replace any % wildcards with its &lt;SPAN style="color: #545454; font-family: arial, sans-serif; font-size: small;"&gt;hexadecimal encoding %25&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g. replace misbehaving expressions such as &lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;myField LIKE '%Ca%' &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;with&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;myField LIKE '%25Ca%25'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works well for me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 00:37:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setdefinitionexpression-and-like-operator-and/m-p/555945#M51867</guid>
      <dc:creator>GustafJonsson</dc:creator>
      <dc:date>2014-09-25T00:37:20Z</dc:date>
    </item>
  </channel>
</rss>

