<?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 Queries not returning anything in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-queries-not-returning-anything/m-p/513910#M3503</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't tried this using the Android SDK QueryParameters. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The example in the developer help shows a query with no quotes at all around the field name - have you tried without quotes around the field name?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The developer help example was: &lt;SPAN style="color: #333333; font-family: arial, sans-serif;"&gt; 'POP2000 &amp;gt; 500000'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Jul 2014 01:23:46 GMT</pubDate>
    <dc:creator>OwenEarley</dc:creator>
    <dc:date>2014-07-28T01:23:46Z</dc:date>
    <item>
      <title>FeatureLayer Queries not returning anything</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-queries-not-returning-anything/m-p/513907#M3500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having trouble getting (offline) Feature Layer queries to return expected results. If I do a simple query with a Where 1=1 clause I get all features as expected. If I do a query with the a Where 'AreaName' = 'example' I get no results but no error message either. I have tested the same query in ArcMap and against the Feature Server on ArcGIS server and both work as expected. When I do the first query I can see that there is data that should satisfy the query in the Feature Layer but it is not being returned. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="java" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14065049051183676" jivemacro_uid="_14065049051183676" modifiedtitle="true"&gt;
&lt;P&gt;QueryParameters params = new QueryParameters();&lt;/P&gt;
&lt;P&gt;params.setWhere("'AreaName' = '" + areaName + "'");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;featureLayer.getFeatureTable().queryFeatures(params, new CallbackListener&amp;lt;FeatureResult&amp;gt;() {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onError(Throwable e) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Handle error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Override&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void onCallback(FeatureResult objs) {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArrayList&amp;lt;String&amp;gt; items = new ArrayList&amp;lt;String&amp;gt;();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for(Object o : objs){ &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(o instanceof Feature){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Feature f = (Feature) o;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String item = (String) f.getAttributeValue("Line");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(item != null &amp;amp;&amp;amp; !items.contains(item)){&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; items.add(transect);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anything wrong with the way I am doing the query?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jul 2014 23:51:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-queries-not-returning-anything/m-p/513907#M3500</guid>
      <dc:creator>ChrisWhite</dc:creator>
      <dc:date>2014-07-27T23:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Queries not returning anything</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-queries-not-returning-anything/m-p/513908#M3501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This may also be the issue with your query - try using double quotes around the field name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ArcMap the field name is normally enclosed in double quotes and the query value for strings is in single quotes. For example in a test data set I can run the following Select By Attributes query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"HydroName" = 'Richmond River'&amp;nbsp; --&amp;gt; returns 44 records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if I change the query:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'HydroName' = 'Richmond River' --&amp;gt; returns 0 records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interestingly, the second query can be verified and runs but returns no records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also tried this in ArcMap against one of the ESRI sample feature services&lt;/P&gt;&lt;P&gt;&lt;A href="http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer" title="http://sampleserver6.arcgisonline.com/arcgis/rest/services/DamageAssessment/FeatureServer"&gt;DamageAssessment (FeatureServer)&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"inspector" = 'Fred' --&amp;gt; returns 37 records&lt;/P&gt;&lt;P&gt;'inspector' = 'Fred' --&amp;gt; returns 0 records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just out of interest, I also tried using no quotation marks around the field name and the query worked:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inspector = 'Fred' --&amp;gt; returns 37 records&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 00:59:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-queries-not-returning-anything/m-p/513908#M3501</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2014-07-28T00:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Queries not returning anything</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-queries-not-returning-anything/m-p/513909#M3502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Owen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried adding double quotes but this causes a runtime error: Error: Failed to execute query. Check whether query is valid. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm guessing they switched it around to avoid having to escape the double quote characters?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 01:16:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-queries-not-returning-anything/m-p/513909#M3502</guid>
      <dc:creator>ChrisWhite</dc:creator>
      <dc:date>2014-07-28T01:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Queries not returning anything</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-queries-not-returning-anything/m-p/513910#M3503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't tried this using the Android SDK QueryParameters. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The example in the developer help shows a query with no quotes at all around the field name - have you tried without quotes around the field name?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The developer help example was: &lt;SPAN style="color: #333333; font-family: arial, sans-serif;"&gt; 'POP2000 &amp;gt; 500000'&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 01:23:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-queries-not-returning-anything/m-p/513910#M3503</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2014-07-28T01:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Queries not returning anything</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-queries-not-returning-anything/m-p/513911#M3504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's done the trick! That makes sense now that I think about it. The way I had it was most likely comparing two strings so was never going to return anything. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 01:48:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/featurelayer-queries-not-returning-anything/m-p/513911#M3504</guid>
      <dc:creator>ChrisWhite</dc:creator>
      <dc:date>2014-07-28T01:48:15Z</dc:date>
    </item>
  </channel>
</rss>

