<?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: Definition expression not working in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1586297#M6278</link>
    <description>&lt;P&gt;I have a strange issue related to set a complex definition expression with date field queries to mapservice subLayer the issue was introduced with me in arcgis sdk with ios and with kotlin as well&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then I have made sure this is not related to the sdk itself so I have tried with arcgis js api and I found out this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;- for setting the expression that includes date time queries to feature layer it works well as expected&amp;nbsp;&lt;/P&gt;&lt;P&gt;-for setting the expression that includes date time queries to map service sublayer it doesn't work as expected at all and it returns all features in layer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var dynamicMapServiceLayer = new FeatureLayer({&lt;BR /&gt;url: "&lt;A href="https://myhost/server/rest/services/App/app/MapServer/1" target="_blank" rel="noopener"&gt;https://myhost/server/rest/services/App/app/MapServer/1&lt;/A&gt;",&lt;BR /&gt;id: 'baseMap',&lt;BR /&gt;definitionExpression: "USER_NAME = 'test' AND (SIGHTING_DATE &amp;gt;= DATE '2025-02-17' AND SIGHTING_DATE &amp;lt; DATE '2025-02-18')"&lt;BR /&gt;});&lt;BR /&gt;var dynamicMapServiceLayer = new MapImageLayer({&lt;BR /&gt;url: "&lt;A href="https://myhost/server/rest/services/App/app/MapServer" target="_blank" rel="noopener"&gt;https://myhost/server/rest/services/App/app/MapServer&lt;/A&gt;",&lt;BR /&gt;id: 'baseMap',&lt;BR /&gt;sublayers: [&lt;BR /&gt;{&lt;BR /&gt;id: 1,&lt;BR /&gt;visible: true,&lt;BR /&gt;definitionExpression: "USER_NAME = 'test' AND (SIGHTING_DATE &amp;gt;= DATE '2025-02-17' AND SIGHTING_DATE &amp;lt; DATE '2025-02-18')"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;I guess it is an issue with server of how to process definition expression for both&lt;BR /&gt;I hope to resolve this issue soon&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3014"&gt;@MichaelBranscomb&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Feb 2025 11:59:50 GMT</pubDate>
    <dc:creator>MahmoudAdel1</dc:creator>
    <dc:date>2025-02-18T11:59:50Z</dc:date>
    <item>
      <title>Definition expression not working</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1232047#M5890</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;I'm developing an Android app (Java) using the Runtime SDK for Android.&lt;/P&gt;&lt;P&gt;I'm trying to create a definition condition for a FeatureLayer, to only show features with 'Tipo = Autotanque' and with 'Capacidade &amp;gt; 500 (liters)'.&lt;/P&gt;&lt;P&gt;I tried the following lines of code:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;PRE&gt;featureLayer.setDefinitionExpression(&lt;SPAN&gt;"Tipo = 'Autotanque' WHERE CAPACIDADE &amp;gt; '500'"&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/LI-SPOILER&gt;&lt;LI-SPOILER&gt;&lt;PRE&gt;featureLayer.setDefinitionExpression(&lt;SPAN&gt;"Tipo = 'Autotanque' AND CAPACIDADE &amp;gt; '500'"&lt;/SPAN&gt;)&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;After testing only the first part of the expression (&lt;SPAN&gt;Tipo = 'Autotanque'), it worked, but the second part of the definition expression is not being read properly as no features are shown.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please guide me on how to build this expression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 00:05:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1232047#M5890</guid>
      <dc:creator>maglourenco</dc:creator>
      <dc:date>2022-11-16T00:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Definition expression not working</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1232069#M5891</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;What field type is&amp;nbsp;CAPACIDADE? If it's numeric then you may need to omit the ' ' around the value&lt;/P&gt;&lt;P&gt;e.g.&amp;nbsp;req_Type = 'Tree Maintenance or Damage' AND req_id &amp;gt; 40000&lt;/P&gt;&lt;P&gt;You can test this specific example here:&amp;nbsp;&lt;A href="https://services2.arcgis.com/ZQgQTuoyBrtmoGdP/ArcGIS/rest/services/SF_311_Incidents/FeatureServer/0/query" target="_blank"&gt;Query: Incidents (ID: 0) (arcgis.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 02:13:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1232069#M5891</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2022-11-16T02:13:57Z</dc:date>
    </item>
    <item>
      <title>Re: Definition expression not working</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1232142#M5892</link>
      <description>&lt;P&gt;Hello Michael,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your reply.&lt;/P&gt;&lt;P&gt;I decided it's more convenient to use QueryPameters in FeatureLayer.queryFeaturesAsync for the purpose I want.&lt;/P&gt;&lt;P&gt;Regarding your question, it is a numeric field. I also tried without the quotes ' and had the same result (forgot to mention that).&lt;/P&gt;&lt;P&gt;Thank you very much for your reply&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 11:04:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1232142#M5892</guid>
      <dc:creator>maglourenco</dc:creator>
      <dc:date>2022-11-16T11:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Definition expression not working</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1232200#M5893</link>
      <description>&lt;P&gt;... if you're looking for client-side display filtering you might also consider using Display Filters:&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/query-and-edit/query/#display-filters" target="_blank"&gt;Query | ArcGIS Runtime API for .NET | ArcGIS Developers&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 15:04:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1232200#M5893</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2022-11-16T15:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Definition expression not working</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1232526#M5894</link>
      <description>&lt;P&gt;I accepted this answer as the solution. I found out I had some features not prepared to be queried. After deleting the malfunctioning features, my query went through as successful.&lt;/P&gt;&lt;P&gt;I used the following query&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;"Capacidade &amp;gt; 500 AND Tipo LIKE 'Autotanque'"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;I decided it was more convenient to use FeatureLayer.&lt;SPAN&gt;queryFeaturesAsync rather than the FeatureLayer.setDefinitionExpression.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Nov 2022 23:24:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1232526#M5894</guid>
      <dc:creator>maglourenco</dc:creator>
      <dc:date>2022-11-16T23:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Definition expression not working</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1586297#M6278</link>
      <description>&lt;P&gt;I have a strange issue related to set a complex definition expression with date field queries to mapservice subLayer the issue was introduced with me in arcgis sdk with ios and with kotlin as well&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then I have made sure this is not related to the sdk itself so I have tried with arcgis js api and I found out this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;- for setting the expression that includes date time queries to feature layer it works well as expected&amp;nbsp;&lt;/P&gt;&lt;P&gt;-for setting the expression that includes date time queries to map service sublayer it doesn't work as expected at all and it returns all features in layer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var dynamicMapServiceLayer = new FeatureLayer({&lt;BR /&gt;url: "&lt;A href="https://myhost/server/rest/services/App/app/MapServer/1" target="_blank" rel="noopener"&gt;https://myhost/server/rest/services/App/app/MapServer/1&lt;/A&gt;",&lt;BR /&gt;id: 'baseMap',&lt;BR /&gt;definitionExpression: "USER_NAME = 'test' AND (SIGHTING_DATE &amp;gt;= DATE '2025-02-17' AND SIGHTING_DATE &amp;lt; DATE '2025-02-18')"&lt;BR /&gt;});&lt;BR /&gt;var dynamicMapServiceLayer = new MapImageLayer({&lt;BR /&gt;url: "&lt;A href="https://myhost/server/rest/services/App/app/MapServer" target="_blank" rel="noopener"&gt;https://myhost/server/rest/services/App/app/MapServer&lt;/A&gt;",&lt;BR /&gt;id: 'baseMap',&lt;BR /&gt;sublayers: [&lt;BR /&gt;{&lt;BR /&gt;id: 1,&lt;BR /&gt;visible: true,&lt;BR /&gt;definitionExpression: "USER_NAME = 'test' AND (SIGHTING_DATE &amp;gt;= DATE '2025-02-17' AND SIGHTING_DATE &amp;lt; DATE '2025-02-18')"&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;I guess it is an issue with server of how to process definition expression for both&lt;BR /&gt;I hope to resolve this issue soon&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3014"&gt;@MichaelBranscomb&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 11:59:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1586297#M6278</guid>
      <dc:creator>MahmoudAdel1</dc:creator>
      <dc:date>2025-02-18T11:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Definition expression not working</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1586301#M6279</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can you create a new post for your question?&lt;/P&gt;&lt;P&gt;If you're using ArcGIS Runtime SDK for Android 100.x:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/bd-p/arcgis-runtime-sdk-for-android-questions" target="_blank"&gt;ArcGIS Runtime SDK for Android Questions - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you're using ArcGIS Maps SDK for Kotlin 200.x:&amp;nbsp;&lt;A href="https://community.esri.com/t5/kotlin-maps-sdk-questions/bd-p/kotlin-maps-sdk-questions" target="_blank"&gt;Kotlin Maps SDK Questions - Esri Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 12:19:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1586301#M6279</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2025-02-18T12:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Definition expression not working</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1586309#M6280</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I found a solution for this. The reason why this issue is our used database is SQL Server so the syntax for definition expression [for date time] is not proper for SQL Server in export map service request so when I use this:&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;"USER_NAME = 'test' AND SIGHTING_DATE BETWEEN&amp;nbsp; CAST('2025-02-17' AS&amp;nbsp;DATE ) AND CAST('2025-02-18' AS DATE))"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Feb 2025 13:36:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/definition-expression-not-working/m-p/1586309#M6280</guid>
      <dc:creator>MahmoudAdel1</dc:creator>
      <dc:date>2025-02-18T13:36:38Z</dc:date>
    </item>
  </channel>
</rss>

