<?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: Query FeatureLayer with Definition Expression in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-featurelayer-with-definition-expression/m-p/249942#M23164</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you want to&amp;nbsp;get the query object from&amp;nbsp;the createQuery() method of the layer to honor its current configuration.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createQuery"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createQuery&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 May 2019 17:00:17 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2019-05-23T17:00:17Z</dc:date>
    <item>
      <title>Query FeatureLayer with Definition Expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-featurelayer-with-definition-expression/m-p/249940#M23162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to run a queryExtent() on a FeatureLayer that has a Definition Expression applied, but it seems to ignore the Definition Expression when query.where is given. I'm trying to zoom to the selected states, but not AK/HI because there are inset maps for those.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;var mydefinitionExpression = makeStateQuery();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; const layer = new FeatureLayer({&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;url: url,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt;&amp;nbsp;definitionExpression: mydefinitionExpression,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; });&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;layer.when(function(){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;var query = layer.createQuery();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;query.where = "(StateFIPSN &amp;lt;&amp;gt; 02 AND StateFIPSN &amp;lt;&amp;gt; 15)";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;return layer.queryExtent(query);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; })&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; .then(function(response){ &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;view.goTo({&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;target:response.extent,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;duration:500&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #3366ff;"&gt; });&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN class="" style="color: #881391;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It seems like I should be able to use both where and defEx, but the extent returned indicates that it's one or the other.&amp;nbsp; Am I missing something?&lt;/P&gt;&lt;P&gt;&lt;SPAN class="" style="color: #881391;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2019 13:31:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-featurelayer-with-definition-expression/m-p/249940#M23162</guid>
      <dc:creator>JeremyLyman</dc:creator>
      <dc:date>2019-05-23T13:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Query FeatureLayer with Definition Expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-featurelayer-with-definition-expression/m-p/249941#M23163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeremy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;This sample shows how it is done. You need to combine the where SQL and definition Expression SQL into either the query where or the layer&amp;nbsp;&lt;SPAN&gt;definition Expression before querying.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=featurelayer-queryextent"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=featurelayer-queryextent&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2019 14:02:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-featurelayer-with-definition-expression/m-p/249941#M23163</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-05-23T14:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Query FeatureLayer with Definition Expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-featurelayer-with-definition-expression/m-p/249942#M23164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you want to&amp;nbsp;get the query object from&amp;nbsp;the createQuery() method of the layer to honor its current configuration.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createQuery"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createQuery&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2019 17:00:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-featurelayer-with-definition-expression/m-p/249942#M23164</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2019-05-23T17:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Query FeatureLayer with Definition Expression</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-featurelayer-with-definition-expression/m-p/249943#M23165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, yes inspecting the object returned from createQuery() at runtime reveals it already contains the string used by the Definition Query.&amp;nbsp; So setting the where property does indeed overwrite the previous requirement.&amp;nbsp; I'll just have to combine the two together.&amp;nbsp; A little disappointing, I'd hoped it worked more like definition expressions in ArcMap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your insights!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2019 19:03:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/query-featurelayer-with-definition-expression/m-p/249943#M23165</guid>
      <dc:creator>JeremyLyman</dc:creator>
      <dc:date>2019-05-24T19:03:57Z</dc:date>
    </item>
  </channel>
</rss>

