<?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: Feature Layer setDefinitionExpression issue with LIKE operator and wildcards in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-setdefinitionexpression-issue-with/m-p/374236#M34725</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That doesn't seem to be the case in this &lt;A href="https://developers.arcgis.com/javascript/jssamples/fl_layer_definition.html"&gt;sample&lt;/A&gt;. Working in the &lt;A href="http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=fl_layer_definition"&gt;sandbox&lt;/A&gt;, you'll get different features with&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_14128854878544140" jivemacro_uid="_14128854878544140"&gt;
&lt;P&gt;featureLayer.setDefinitionExpression("PROD_GAS Like '%Y%'");&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;versus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14128854310317867 jive_text_macro" jivemacro_uid="_14128854310317867"&gt;
&lt;P&gt;featureLayer.setDefinitionExpression("PROD_GAS Like '%N%'");&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using "PROD_GAS Like '%Y%'" gives the same result as "PROD_GAS Like '%s'" (this field contains "Yes" or "No").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your example, do you get any features returned with &lt;SPAN class="string"&gt;FACILITYIDs &lt;/SPAN&gt;that don't contain an "a"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Oct 2014 20:12:09 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2014-10-09T20:12:09Z</dc:date>
    <item>
      <title>Feature Layer setDefinitionExpression issue with LIKE operator and wildcards</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-setdefinitionexpression-issue-with/m-p/374235#M34724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm running into an issue with setDefinitionExpression on a Feature Layer... If the value &lt;STRONG&gt;starts&lt;/STRONG&gt; with a wildcard, all features will be returned (basically, the definition expression is not applied - if the layer has a default expression, that will still be applied). So, I'm doing something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14128842506706654 jive_text_macro" jivemacro_uid="_14128842506706654"&gt;
&lt;P&gt;featureLayer.setDefinitionExpression("FACILITYID LIKE'%a%'");&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;OR&lt;/EM&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14128844398726000 jive_text_macro" jivemacro_uid="_14128844398726000"&gt;
&lt;P&gt;featureLayer.setDefinitionExpression("FACILITYID LIKE'%a'");&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This expression works in query tasks and when applied as a definition query for the service layer, so I'm thinking this is a bug with the API, but maybe I'm missing something.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, the following works, so this appears to fail only when the value starts with a wildcard:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14128843980454955 jive_text_macro" jivemacro_uid="_14128843980454955" modifiedtitle="true"&gt;
&lt;P&gt;featureLayer.setDefinitionExpression("FACILITYID LIKE'a%'");&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 19:57:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-setdefinitionexpression-issue-with/m-p/374235#M34724</guid>
      <dc:creator>JamesWoodburn</dc:creator>
      <dc:date>2014-10-09T19:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer setDefinitionExpression issue with LIKE operator and wildcards</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-setdefinitionexpression-issue-with/m-p/374236#M34725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That doesn't seem to be the case in this &lt;A href="https://developers.arcgis.com/javascript/jssamples/fl_layer_definition.html"&gt;sample&lt;/A&gt;. Working in the &lt;A href="http://developers.arcgis.com/javascript/sandbox/sandbox.html?sample=fl_layer_definition"&gt;sandbox&lt;/A&gt;, you'll get different features with&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_14128854878544140" jivemacro_uid="_14128854878544140"&gt;
&lt;P&gt;featureLayer.setDefinitionExpression("PROD_GAS Like '%Y%'");&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;versus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14128854310317867 jive_text_macro" jivemacro_uid="_14128854310317867"&gt;
&lt;P&gt;featureLayer.setDefinitionExpression("PROD_GAS Like '%N%'");&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using "PROD_GAS Like '%Y%'" gives the same result as "PROD_GAS Like '%s'" (this field contains "Yes" or "No").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your example, do you get any features returned with &lt;SPAN class="string"&gt;FACILITYIDs &lt;/SPAN&gt;that don't contain an "a"?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Oct 2014 20:12:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-setdefinitionexpression-issue-with/m-p/374236#M34725</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2014-10-09T20:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Feature Layer setDefinitionExpression issue with LIKE operator and wildcards</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-setdefinitionexpression-issue-with/m-p/374237#M34726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my case I &lt;EM&gt;was&lt;/EM&gt; get back all features, whether they include and 'a' or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for that sandbox example, it helped isolate my testing. I noticed that sandbox example starts to act strangely once I change the layer mode to SNAPSHOT, so I changed my layer from SNAPSHOT to ONDEMAND on a wild guess and the filter worked as expected. However, when I switched it back it was &lt;EM&gt;still&lt;/EM&gt; working properly. I guess I'm going to chalk this up to a strange cache issue or something.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Oct 2014 12:17:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/feature-layer-setdefinitionexpression-issue-with/m-p/374237#M34726</guid>
      <dc:creator>JamesWoodburn</dc:creator>
      <dc:date>2014-10-10T12:17:10Z</dc:date>
    </item>
  </channel>
</rss>

