<?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: SetDefinitionExpression in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setdefinitionexpression/m-p/412043#M37948</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect thanks Ken! That was it.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Aug 2018 14:14:32 GMT</pubDate>
    <dc:creator>ShawnRoberts1</dc:creator>
    <dc:date>2018-08-02T14:14:32Z</dc:date>
    <item>
      <title>SetDefinitionExpression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setdefinitionexpression/m-p/412041#M37946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, I'm fairly new to the world of the Javascript API, so I apologize if this is a very simple question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm attempting to build out a simple form that filters data based on the users input. I've just been testing using samples of code I've found on the JS API site to see what is the best way to do this. The small sample I've made I'm attempting to just update the definitionexpression on the click event following (&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#definitionExpression"&gt;FeatureLayer | API Reference | ArcGIS API for JavaScript 4.8&lt;/A&gt;). However whenever I try to use this I keep getting the error "layer.setDefinitionExpression is not a function". Any advise about the error or a better way to do dynamic filtering based on a form.&amp;nbsp; I've attached my sample code for anyone to assist with! Again, it's pretty dirty I'm just testing what I can do.&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;const layer = new FeatureLayer({&lt;BR /&gt;&lt;SPAN&gt; url: "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fservices.arcgis.com%2FV6ZHFr6zdgNZuVG0%2Farcgis%2Frest%2Fservices%2FLandscape_Trees%2FFeatureServer%2F0" rel="nofollow" target="_blank"&gt;https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Landscape_Trees/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;",&lt;/SPAN&gt;&lt;BR /&gt; definitionExpression: "Sci_Name = 'Ulmus pumila'"&lt;BR /&gt; });&lt;BR /&gt; map.add(layer)&lt;BR /&gt; &lt;BR /&gt; var filter = document.getElementById("button");&lt;BR /&gt; filter.addEventListener("click", function(event){&lt;BR /&gt; var newValue = "HEIGHT &amp;gt; 50";&lt;BR /&gt; layer.setDefinition&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Shawn.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2018 13:54:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setdefinitionexpression/m-p/412041#M37946</guid>
      <dc:creator>ShawnRoberts1</dc:creator>
      <dc:date>2018-08-02T13:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: SetDefinitionExpression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setdefinitionexpression/m-p/412042#M37947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're mixing up syntax between 3.x and 4.x. In 4.x, it is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;layer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;definitionExpression &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; newValue&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:08:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setdefinitionexpression/m-p/412042#M37947</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2018-08-02T14:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: SetDefinitionExpression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setdefinitionexpression/m-p/412043#M37948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect thanks Ken! That was it.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2018 14:14:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/setdefinitionexpression/m-p/412043#M37948</guid>
      <dc:creator>ShawnRoberts1</dc:creator>
      <dc:date>2018-08-02T14:14:32Z</dc:date>
    </item>
  </channel>
</rss>

