<?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: Applying extent filter while using the filter manager class in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782622#M2819</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds good, thanks a lot! I'm about to give it a go. I'll report back once it's done.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Aug 2019 02:36:57 GMT</pubDate>
    <dc:creator>shaylavi</dc:creator>
    <dc:date>2019-08-30T02:36:57Z</dc:date>
    <item>
      <title>Applying extent filter while using the filter manager class</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782618#M2815</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm customizing&amp;nbsp;the layers list widget and I'm applying filters to the layers by using the FilterManager from library.&lt;/P&gt;&lt;P&gt;It works&amp;nbsp;like a charm, however, I'm trying to take it a step further by applying an extent filter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My application has one map service with number of layers, which are all query layers.&lt;/P&gt;&lt;P&gt;The service was created in ArcGIS Pro and all layers are simple select statements of views in a PostgresSQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to achieve is a query that returns data only based on the extent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At first I've tried adding the&amp;nbsp;query filter on ArcGIS Pro but it fails.. The syntax is as follow -&lt;/P&gt;&lt;P&gt;ST_Contains(ST_GeomFromText(::view_extent, 4283), shape)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When trying to add it to the view on the database it fails, since view_extent is not supported and the default value is null.&lt;/P&gt;&lt;P&gt;When&amp;nbsp;&lt;SPAN&gt;trying to add it to&amp;nbsp;ArcGIS Pro, &lt;STRONG&gt;it accepts it,&lt;/STRONG&gt; but then can't read the spatial reference or time-aware data..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I also tried adding it as a query definition but it&amp;nbsp;throws a sytax error message.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now I'd like to try and add it at the client side, but I'm applying the query&amp;nbsp;by using the FilterManager&amp;nbsp;- when adding the above line to the&amp;nbsp;query, it&amp;nbsp;just doesn't show anything (I'm guessing it behaves as a query definion and therefore doesn't work).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only option I can think of is to build a query and pass the geometry parameter dynamically, but that's a very long workaround and still I can't see how I can apply it through the FilterManager this way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone ever did something like that before?&lt;/P&gt;&lt;P&gt;Based on the attached article, ArcGIS does support the ::view_extent parameter, yet it doesn't seem to play nice on the web -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/help/data/query-layers/define-parameters-in-a-query-layer.htm" title="https://pro.arcgis.com/en/pro-app/help/data/query-layers/define-parameters-in-a-query-layer.htm"&gt;Define parameters in a query layer—Query layers | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&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;Shay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2019 06:50:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782618#M2815</guid>
      <dc:creator>shaylavi</dc:creator>
      <dc:date>2019-08-29T06:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Applying extent filter while using the filter manager class</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782619#M2816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;The FilterManager is applying the filter to the layer using the definition expression so you will not have the option of using a spatial component like an extent filter. The only option I know of is to build an actual query task using the maps extent and complete get away from using the FilterManager.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2019 18:47:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782619#M2816</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-08-29T18:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Applying extent filter while using the filter manager class</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782620#M2817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Robert, I was affraid that might be the answer.. if I do&amp;nbsp;choose to implement it that way, do you know if the behaviour of the filter will be the same as using the FilterManager? (will it be consistent thoughout the use of the app and layer?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure I fully understand the differences of using the FilterManager rather than a query task.. I assume that the FilterManager is just a wrapper to a query&amp;nbsp;task.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Aug 2019 23:59:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782620#M2817</guid>
      <dc:creator>shaylavi</dc:creator>
      <dc:date>2019-08-29T23:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Applying extent filter while using the filter manager class</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782621#M2818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;No the FilterManager is just a wrapper for the layers definition query (i.e. a where clause that is applied to the layer). When using a QueryTask you will specify the Queries where property and the queries.geometry (with your extent). The where portion is going to be similar to how you used the FilterManager (i.e. passing it a SQL statement for the where clause).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2019 00:37:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782621#M2818</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-08-30T00:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: Applying extent filter while using the filter manager class</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782622#M2819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds good, thanks a lot! I'm about to give it a go. I'll report back once it's done.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2019 02:36:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782622#M2819</guid>
      <dc:creator>shaylavi</dc:creator>
      <dc:date>2019-08-30T02:36:57Z</dc:date>
    </item>
    <item>
      <title>Re: Applying extent filter while using the filter manager class</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782623#M2820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I execute a query task, the results I'm getting are completely&amp;nbsp;separate from my activity.. it's&amp;nbsp;just a set of results and not considered to be part of the active layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to run the query task on a layer from the layer list without managing the results in a separate manner? I'm basically trying to filter the existing layer without creating a new one.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Aug 2019 05:30:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782623#M2820</guid>
      <dc:creator>shaylavi</dc:creator>
      <dc:date>2019-08-30T05:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Applying extent filter while using the filter manager class</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782624#M2821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Shay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Yes a QueryTask returns a FeatureSet of the results but you can use QueryTask.executeForIds and then use the result array to set the layers&amp;nbsp;layerDefinition property.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; qTask &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;QueryTask&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"your url"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; query &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Query&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
query&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;geometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;extent&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
query&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;where &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"your SQL statement"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
qTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;executeForIds&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lang&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hitch&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;results&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; whereClause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; yourLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;objectIdField &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" IN ("&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; results&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;join&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;")"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
yourLayer&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setDefinitionExpression&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;whereClause&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//Assuming the layer is a FeatureLayer&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// or if the layer is an ArcGISDyanmicMapServiceLayer then&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//var layerDefinitions = [];&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//layerDefinitions[0] = whereClause;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//dynamicMapServiceLayer.setLayerDefinitions(layerDefinitions);‍‍‍‍‍‍‍‍‍‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:54:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782624#M2821</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T08:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Applying extent filter while using the filter manager class</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782625#M2822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Genius! thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Aug 2019 05:00:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782625#M2822</guid>
      <dc:creator>shaylavi</dc:creator>
      <dc:date>2019-08-31T05:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Applying extent filter while using the filter manager class</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782626#M2823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;Don’t forget to mark this question as answered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 31 Aug 2019 15:56:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/applying-extent-filter-while-using-the-filter/m-p/782626#M2823</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2019-08-31T15:56:32Z</dc:date>
    </item>
  </channel>
</rss>

