<?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: FeatureLayer (Search with featureLayer) in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611915#M13598</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Faizan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cleaning the data will work, but you did not have to go to that extreme. You could have escaped the single quotes in your data by using a replace and replacing a single quote with two single quotes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;value = value.replace("'","''");&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Mar 2012 12:08:30 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2012-03-08T12:08:30Z</dc:date>
    <item>
      <title>FeatureLayer (Search with featureLayer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611910#M13593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; i am trying to use the search with featureLayer sample. i have a feature layer and am using in a loop (as obj.name changes)&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;queryExpression = queryExpression + customLayer.layerDetails.fields[3].name + " like '%" + obj.name + "%'"+" OR " if(queryExpression.length &amp;gt; 4) {&amp;nbsp; queryExpression = queryExpression.substring(0,queryExpression.length - 4); } customLayer.definitionExpression = queryExpression&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The above works fine and the featurelayer is filtered based upon the query if there are only 10 increments in the loop meaning there are around 9 'ORs' in the queryExpression statement. However the moment another OR is appended to the queryExpression, i get a unable to complete operation error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does this mean that within the definitionExpression, only 9 OR operators can be used? Is there such limit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What i want to achieve is based upon the obj.name which can be from 1 to 100, i want to highlight the features which fullfill the query conditions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there anyway to filter features based not on only one value but multiple values.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 15:32:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611910#M13593</guid>
      <dc:creator>FaizanTayyab</dc:creator>
      <dc:date>2012-03-06T15:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer (Search with featureLayer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611911#M13594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Faizan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Well it seems like your issue is a inexperience with SQL statements. The cost of doing a "LIKE" statement in a query is very expensive compared to a "=" and then you are tacking on multiple likes using OR and this turns out to be a Extremely poorly written SQL Statement that is VERY expensive. You need to get away from LIKE queries if at all possible and if you are going to use Multiple AND or ORs in your Query than you need to use "IN".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;queryExpression = customLayer.layerDetails.fields[3].name + " IN (1,2,3,4,5,6,7,8,9,10)";&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't forget to &lt;/SPAN&gt;&lt;STRONG&gt;click the Mark as answer check&lt;/STRONG&gt;&lt;SPAN&gt; and to &lt;/SPAN&gt;&lt;STRONG&gt;click the top arrow (promote)&lt;/STRONG&gt;&lt;SPAN&gt; as shown below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;IMG src="http://gis.calhouncounty.org/FlexViewer2.5/Answer.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Mar 2012 16:12:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611911#M13594</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2012-03-06T16:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer (Search with featureLayer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611912#M13595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply. I am aware of use of IN however in my case, because the queryexpression is built dynamically through looping, i think IN cannot be used. If i am not wrong IN can be used if the possible values and number of values are known, however in my case the obj.name is retrieved through another query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I did find the reason for the query not working, it was due to ' in the query expression because some of the obj.name value have ' in them hence the query expression gets corrupted.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2012 17:12:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611912#M13595</guid>
      <dc:creator>FaizanTayyab</dc:creator>
      <dc:date>2012-03-07T17:12:05Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer (Search with featureLayer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611913#M13596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Faizan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; I do believe that you should still attempt to use the IN operator. Just loop through all your results creating a comma separated list and then when you are done looping add the list to the SQL expression using the IN operator. I believe that you will find that the resulting SQL Expression will function better. So did you figure out how to escape your single quote in the data?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2012 17:20:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611913#M13596</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2012-03-07T17:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer (Search with featureLayer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611914#M13597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Faizan,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; I do believe that you should still attempt to use the IN operator. Just loop through all your results creating a comma separated list and then when you are done looping add the list to the SQL expression using the IN operator. I believe that you will find that the resulting SQL Expression will function better. So did you figure out how to escape your single quote in the data?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Will give that a go. Thanks. For the single quote, i am cleaning the data in the mxd.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2012 20:35:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611914#M13597</guid>
      <dc:creator>FaizanTayyab</dc:creator>
      <dc:date>2012-03-07T20:35:34Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer (Search with featureLayer)</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611915#M13598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Faizan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Cleaning the data will work, but you did not have to go to that extreme. You could have escaped the single quotes in your data by using a replace and replacing a single quote with two single quotes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;value = value.replace("'","''");&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Mar 2012 12:08:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/featurelayer-search-with-featurelayer/m-p/611915#M13598</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2012-03-08T12:08:30Z</dc:date>
    </item>
  </channel>
</rss>

