<?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 Definition Expression in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1419905#M84518</link>
    <description>&lt;P&gt;It should be layer.definitionExpression = "Consultant = 'Pediatrics'"&lt;/P&gt;</description>
    <pubDate>Tue, 07 May 2024 14:10:53 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2024-05-07T14:10:53Z</dc:date>
    <item>
      <title>FeatureLayer Definition Expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1419873#M84517</link>
      <description>&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;I am trying to implement Definition Expression on Feature Layer.&lt;/P&gt;&lt;P&gt;In our application account and consultant are stored in db as json format&amp;nbsp;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;{"Account": "Hospital", "Consultant": "Pediatrics"} datatype charcter varaying.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Now when i am trying to filter data on definition expression&amp;nbsp;&lt;STRONG&gt;"Consultant": "Pediatrics" and it is not giving any result.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 13:19:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1419873#M84517</guid>
      <dc:creator>SaurabhUpadhyaya</dc:creator>
      <dc:date>2024-05-07T13:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Definition Expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1419905#M84518</link>
      <description>&lt;P&gt;It should be layer.definitionExpression = "Consultant = 'Pediatrics'"&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 14:10:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1419905#M84518</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2024-05-07T14:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Definition Expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1420021#M84519</link>
      <description>&lt;P&gt;If the JSON text is stored in string format like shown, I think you'd need a query more like the following (where "FIELD_NAME" is the name of the field being filtered):&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;FIELD_NAME LIKE '%"Consultant": "Pediatrics"%'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Setting the definitionExpression would then be something like:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;layer.definitionExpression = "FIELD_NAME LIKE '%\"Consultant\": \"Pediatrics\"%'";&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 May 2024 17:20:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1420021#M84519</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2024-05-07T17:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Definition Expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1420321#M84527</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your response and it is working fine.&lt;/P&gt;&lt;P&gt;Now as i explained in previous question data is stored in json format where some values are integer/ double where i want to use &amp;lt; less than or &amp;gt; greater than operator in definition expression.&lt;/P&gt;&lt;P&gt;JSON Data :&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;{"Account": "Hospital", "Consultant": "Pediatrics", "Sales": 65.0, "Assets": 2.5}&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;definition expression :&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is just an idea not exactly, want to add and Sales &amp;gt; 65.0 with existing definition expression (&lt;STRONG&gt;"Consultant": "Pediatrics" and&amp;nbsp; Sales &amp;gt; 65.0)&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;FIELD_NAME LIKE '%"Consultant": "Pediatrics"%' &lt;/LI-CODE&gt;&lt;P&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 10:25:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1420321#M84527</guid>
      <dc:creator>SaurabhUpadhyaya</dc:creator>
      <dc:date>2024-05-08T10:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Definition Expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1420566#M84529</link>
      <description>&lt;P&gt;This is admittedly ugly, and there may be a better way, but in theory it should work:&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;FIELD_NAME LIKE '%"Consultant": "Pediatrics"%' AND TO_NUMBER(SUBSTR(FIELD_NAME, INSTR(FIELD_NAME, 1, '"Sales": ') + 9, INSTR(FIELD_NAME, 1, ', "Assets":') - (INSTR(FIELD_NAME, 1, '"Sales": ') + 9))) &amp;gt; 65&lt;/LI-CODE&gt;&lt;P&gt;Some databases out there like Oracle &lt;A href="https://docs.oracle.com/en/database/oracle/oracle-database/23/adjsn/intro-to-json-data-and-oracle-database.html#GUID-17642E43-7D87-4590-8870-06E9FDE9A6E9" target="_self"&gt;provide native support for JSON fields&lt;/A&gt;, but I don't think ArcGIS necessarily supports that field type though.&lt;/P&gt;</description>
      <pubDate>Wed, 08 May 2024 17:08:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1420566#M84529</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2024-05-08T17:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Definition Expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1431287#M84549</link>
      <description>&lt;P&gt;Its not working.&lt;/P&gt;&lt;P&gt;In my postgres db data stored in character varaying datatype and values are stored in json format.&lt;/P&gt;&lt;P&gt;Can you please check again,&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 13:15:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1431287#M84549</guid>
      <dc:creator>SaurabhUpadhyaya</dc:creator>
      <dc:date>2024-05-10T13:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Definition Expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1431317#M84550</link>
      <description>&lt;P&gt;I have followed the syntax provided on&amp;nbsp;&lt;A href="https://enterprise.arcgis.com/en/server/latest/administer/linux/about-standardized-queries.htm" target="_blank"&gt;https://enterprise.arcgis.com/en/server/latest/administer/linux/about-standardized-queries.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 13:20:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1431317#M84550</guid>
      <dc:creator>SaurabhUpadhyaya</dc:creator>
      <dc:date>2024-05-10T13:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: FeatureLayer Definition Expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1432747#M84552</link>
      <description>&lt;P&gt;My background is primarily in Oracle, and I've never used Postgres.&amp;nbsp; If you're limited to standardized queries then you won't be able to do this with just a definitionExpression.&lt;/P&gt;&lt;P&gt;An alternative would be to &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-query.html" target="_self"&gt;query&lt;/A&gt; the service with the filters you can use, further filter the results on the client-side, and then add all matching features to a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-GraphicsLayer.html" target="_self"&gt;GraphicsLayer&lt;/A&gt; or &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#source" target="_self"&gt;client-side FeatureLayer&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 16:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/featurelayer-definition-expression/m-p/1432747#M84552</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2024-05-10T16:53:01Z</dc:date>
    </item>
  </channel>
</rss>

