<?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 Issue Setting Layer Definition on Feature Layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-setting-layer-definition-on-feature-layer/m-p/298343#M27396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an app that pulls in an AGOL feature layer which contains nearly 15000 features.&amp;nbsp; I would like the app to do two things, the second I already have setup, it's the first that I can't figure out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; I need the page to pull in only certain features that meet a specified definition query.&amp;nbsp; Which doesn't seem to work.&amp;nbsp; I tried using this example&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jssamples/fl_layer_definition.html" title="https://developers.arcgis.com/javascript/3/jssamples/fl_layer_definition.html"&gt;Feature layer with layer definition applied | ArcGIS API for JavaScript 3.21&lt;/A&gt;&amp;nbsp;however when I pull the feature in, the definition set doesn't hold, thus it returns features that I know don't meet the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. This could be causing issue one, but I'm not sure.&amp;nbsp; Later in the JS I have another function that sets another definition expression on the same layer, which doesn't contain the original definition.&amp;nbsp; This part works, but as stated, the first definition doesn't work.&amp;nbsp; Is this actually overriding the first query?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, say I have 1000 features that are in the state of SC among a feature layer that contains all 50 states.&amp;nbsp; Those same features in SC have an attribute for county.&amp;nbsp; What I want to be able to do is, when the page loads using FeatureLayer Mode SNAPSHOT, ONLY pull into memory the state of SC, then later in the code set another expression to get only those in a particular county.&amp;nbsp; Thus in the end, only return the features in SC in X county.&amp;nbsp; &amp;nbsp;This page always works in SC, thus I just wanna set that at the top, then do a more dynamic query later in the code for varying counties.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Charles&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Sep 2017 02:03:50 GMT</pubDate>
    <dc:creator>CharlesGant</dc:creator>
    <dc:date>2017-09-13T02:03:50Z</dc:date>
    <item>
      <title>Issue Setting Layer Definition on Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-setting-layer-definition-on-feature-layer/m-p/298343#M27396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an app that pulls in an AGOL feature layer which contains nearly 15000 features.&amp;nbsp; I would like the app to do two things, the second I already have setup, it's the first that I can't figure out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; I need the page to pull in only certain features that meet a specified definition query.&amp;nbsp; Which doesn't seem to work.&amp;nbsp; I tried using this example&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jssamples/fl_layer_definition.html" title="https://developers.arcgis.com/javascript/3/jssamples/fl_layer_definition.html"&gt;Feature layer with layer definition applied | ArcGIS API for JavaScript 3.21&lt;/A&gt;&amp;nbsp;however when I pull the feature in, the definition set doesn't hold, thus it returns features that I know don't meet the query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. This could be causing issue one, but I'm not sure.&amp;nbsp; Later in the JS I have another function that sets another definition expression on the same layer, which doesn't contain the original definition.&amp;nbsp; This part works, but as stated, the first definition doesn't work.&amp;nbsp; Is this actually overriding the first query?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, say I have 1000 features that are in the state of SC among a feature layer that contains all 50 states.&amp;nbsp; Those same features in SC have an attribute for county.&amp;nbsp; What I want to be able to do is, when the page loads using FeatureLayer Mode SNAPSHOT, ONLY pull into memory the state of SC, then later in the code set another expression to get only those in a particular county.&amp;nbsp; Thus in the end, only return the features in SC in X county.&amp;nbsp; &amp;nbsp;This page always works in SC, thus I just wanna set that at the top, then do a more dynamic query later in the code for varying counties.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Charles&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 02:03:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-setting-layer-definition-on-feature-layer/m-p/298343#M27396</guid>
      <dc:creator>CharlesGant</dc:creator>
      <dc:date>2017-09-13T02:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Setting Layer Definition on Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-setting-layer-definition-on-feature-layer/m-p/298344#M27397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Charles,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; What you are wanting is definitely possible. Can you share how you are adding the second sql portion to your existing definition expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 12:44:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-setting-layer-definition-on-feature-layer/m-p/298344#M27397</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-09-13T12:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Issue Setting Layer Definition on Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-setting-layer-definition-on-feature-layer/m-p/298345#M27398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as I know there's only one definition expression so the way to handle this is to create and maintain&amp;nbsp;a single definition expression. &amp;nbsp;I would guess that you should be appending the second definition expression to the first, separated by an AND.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As your needs get more complicated, sometimes it makes sense to write code that keeps track of your definition expression in some other format (say, an array of strings or a Set) and every time that variable is modified, you'll recalculate your entire definition expression. &amp;nbsp;This lets you add and remove clauses in your defintion expression easily.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2017 14:42:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/issue-setting-layer-definition-on-feature-layer/m-p/298345#M27398</guid>
      <dc:creator>ThomasSolow</dc:creator>
      <dc:date>2017-09-13T14:42:52Z</dc:date>
    </item>
  </channel>
</rss>

