<?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 ServiceFeatureTable Where clause replacement in .NET 100.0.X arcgisRuntime in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/servicefeaturetable-where-clause-replacement-in/m-p/245730#M2875</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm upgrading from arcgisRuntime&amp;nbsp; .NET SDK 10.2.5 to 100.9.0. I am trying to find a suitable replacement for code like this:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;string whereClause = "RouteID = 100" //Actually changes based on user interaction&lt;/P&gt;&lt;P&gt;ServiceFeatureTable serviceFeatureTable = featureLayer.FeatureTable as ServiceFeatureTable;&lt;BR /&gt; serviceFeatureTable.Where = whereClause;&lt;BR /&gt; serviceFeatureTable.RefreshFeatures(false);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The intent is we only show a handful (usually only 1) of the features in the feature layer. The where clause is actually built dynamically based on what the user is doing. The closest I can find is setting visibility on the features, but first I have to find all the other features and set their visibility as false:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;//Hide All Features&lt;/P&gt;&lt;P&gt;QueryParameters queryParams = new QueryParameters();&lt;BR /&gt; queryParams.WhereClause = "1 = 1";&lt;BR /&gt; queryParams.MaxFeatures = Int32.MaxValue; //Doesn't seem to work&lt;BR /&gt; FeatureQueryResult allFeatures = await featureLayer.FeatureTable.QueryFeaturesAsync(queryParams);&lt;/P&gt;&lt;P&gt;long l = allFeatures.Count(); // Just for debugging&lt;/P&gt;&lt;P&gt;featureLayer.SetFeaturesVisible(allFeatures.ToList(), false);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Show features matching query&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;string whereClause = "RouteID = 100"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;queryParams = new QueryParameters();&lt;BR /&gt; queryParams.WhereClause = whereClause;&lt;BR /&gt; FeatureQueryResult filterResults = await featureLayer.FeatureTable.QueryFeaturesAsync(queryParams);&lt;/P&gt;&lt;P&gt;featureLayer.SetFeaturesVisible(filterResults.ToList(),true);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;And this actually doesn't work either because it looks&amp;nbsp;like&amp;nbsp;the max number of features returned is 1000. It also seems very inefficient. Is there more straightforward way of hiding all the features except those that match a SQL type query?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Oct 2020 16:30:04 GMT</pubDate>
    <dc:creator>KoryKarr</dc:creator>
    <dc:date>2020-10-16T16:30:04Z</dc:date>
    <item>
      <title>ServiceFeatureTable Where clause replacement in .NET 100.0.X arcgisRuntime</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/servicefeaturetable-where-clause-replacement-in/m-p/245730#M2875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm upgrading from arcgisRuntime&amp;nbsp; .NET SDK 10.2.5 to 100.9.0. I am trying to find a suitable replacement for code like this:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;string whereClause = "RouteID = 100" //Actually changes based on user interaction&lt;/P&gt;&lt;P&gt;ServiceFeatureTable serviceFeatureTable = featureLayer.FeatureTable as ServiceFeatureTable;&lt;BR /&gt; serviceFeatureTable.Where = whereClause;&lt;BR /&gt; serviceFeatureTable.RefreshFeatures(false);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The intent is we only show a handful (usually only 1) of the features in the feature layer. The where clause is actually built dynamically based on what the user is doing. The closest I can find is setting visibility on the features, but first I have to find all the other features and set their visibility as false:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;//Hide All Features&lt;/P&gt;&lt;P&gt;QueryParameters queryParams = new QueryParameters();&lt;BR /&gt; queryParams.WhereClause = "1 = 1";&lt;BR /&gt; queryParams.MaxFeatures = Int32.MaxValue; //Doesn't seem to work&lt;BR /&gt; FeatureQueryResult allFeatures = await featureLayer.FeatureTable.QueryFeaturesAsync(queryParams);&lt;/P&gt;&lt;P&gt;long l = allFeatures.Count(); // Just for debugging&lt;/P&gt;&lt;P&gt;featureLayer.SetFeaturesVisible(allFeatures.ToList(), false);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Show features matching query&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f6f6f6;"&gt;string whereClause = "RouteID = 100"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;queryParams = new QueryParameters();&lt;BR /&gt; queryParams.WhereClause = whereClause;&lt;BR /&gt; FeatureQueryResult filterResults = await featureLayer.FeatureTable.QueryFeaturesAsync(queryParams);&lt;/P&gt;&lt;P&gt;featureLayer.SetFeaturesVisible(filterResults.ToList(),true);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;And this actually doesn't work either because it looks&amp;nbsp;like&amp;nbsp;the max number of features returned is 1000. It also seems very inefficient. Is there more straightforward way of hiding all the features except those that match a SQL type query?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2020 16:30:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/servicefeaturetable-where-clause-replacement-in/m-p/245730#M2875</guid>
      <dc:creator>KoryKarr</dc:creator>
      <dc:date>2020-10-16T16:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: ServiceFeatureTable Where clause replacement in .NET 100.0.X arcgisRuntime</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/servicefeaturetable-where-clause-replacement-in/m-p/245731#M2876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you're looking for &lt;A href="https://developers.arcgis.com/net/latest/wpf/api-reference/html/P_Esri_ArcGISRuntime_Data_ServiceFeatureTable_DefinitionExpression.htm"&gt;&lt;STRONG&gt;DefinitionExpression&lt;/STRONG&gt;&lt;/A&gt;. This will only retrieve the feature(s) you're interested in. Note that this is also &lt;A href="https://developers.arcgis.com/net/latest/wpf/api-reference/html/P_Esri_ArcGISRuntime_Mapping_FeatureLayer_DefinitionExpression.htm"&gt;exposed through&amp;nbsp;the FeatureLayer&lt;/A&gt;, in case that is a more logical place for you to set it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2020 16:36:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/servicefeaturetable-where-clause-replacement-in/m-p/245731#M2876</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2020-10-16T16:36:03Z</dc:date>
    </item>
    <item>
      <title>Re: ServiceFeatureTable Where clause replacement in .NET 100.0.X arcgisRuntime</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/servicefeaturetable-where-clause-replacement-in/m-p/245732#M2877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that works. Also exposing it on the layer simplifies a bunch of code. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2020 17:16:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/servicefeaturetable-where-clause-replacement-in/m-p/245732#M2877</guid>
      <dc:creator>KoryKarr</dc:creator>
      <dc:date>2020-10-16T17:16:59Z</dc:date>
    </item>
  </channel>
</rss>

