<?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: How to get parent from SubtypeSublayer in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-parent-from-subtypesublayer/m-p/1649823#M13668</link>
    <description>&lt;P&gt;The query operations are on the &lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Mapping.FeatureLayer.FeatureTable.html" target="_self"&gt;FeatureLayer.featureTable&lt;/A&gt; property.&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Data.ArcGISFeatureTable.html" target="_self"&gt;ArcGISFeatureTable&lt;/A&gt;, you can use the Sublayer's subtype code as additional filter in your where clause or use&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Data.SubtypeSubtable.html" target="_self"&gt;SubtypeSubtable&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Whether you're getting SubtypeFeatureLayer from web map or table that supports subtype, you can try the following code. Notice that for "Service Station" subtype (code: 21) on a Pipeline Device there's only 1 feature of this subtype out of 31411 features.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var credential = await AccessTokenCredential.CreateAsync(new Uri("https://sampleserver7.arcgisonline.com/portal/sharing/rest"), "viewer01", "I68VGU^nMurF");
AuthenticationManager.Current.AddCredential(credential);

var geodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGasV6/FeatureServer"));
await geodatabase.LoadAsync();

var table = geodatabase.GetTable(0);
var layer = new SubtypeFeatureLayer(table);

await layer.LoadAsync();

var sublayer = layer.SubtypeSublayers.LastOrDefault();
ArgumentNullException.ThrowIfNull(sublayer);

var query = new QueryParameters();
query.WhereClause = $"{table.SubtypeField} = {sublayer.Subtype.Code}";

ArgumentNullException.ThrowIfNull(layer.FeatureTable);
var features = await layer.FeatureTable.QueryFeaturesAsync(query);

var subtypeTable = new SubtypeSubtable(sublayer.Subtype);
table.SubtypeSubtables.Add(subtypeTable);
var subtypeFeatures = await subtypeTable.QueryFeaturesAsync(new QueryParameters() { WhereClause = "1=1" });

var count = await layer.FeatureTable.QueryFeatureCountAsync(new QueryParameters() { WhereClause = "1=1" });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hm, there is no back-reference to the parent layer from SubtypeSublayer though. Can you describe your workflow, how you have access to the sublayer only but not have access to the layer?&lt;/P&gt;</description>
    <pubDate>Thu, 11 Sep 2025 18:22:44 GMT</pubDate>
    <dc:creator>JenniferNery</dc:creator>
    <dc:date>2025-09-11T18:22:44Z</dc:date>
    <item>
      <title>How to get parent from SubtypeSublayer</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-parent-from-subtypesublayer/m-p/1649806#M13666</link>
      <description>&lt;P&gt;Hi, since SubtypeSublayer cannot be queried, Esri suggested querying the parent SubtypeFeatureLayer in&amp;nbsp;&lt;A href="https://community.esri.com/t5/net-maps-sdk-questions/query-subtypesublayer/td-p/1052311" target="_self"&gt;answer&lt;/A&gt;&amp;nbsp;. Is there a way to get the SubtypeSublayer's parent SubtypeFeatureLayer from the SubtypeSublayer ? SubtypeSublayers in the JavaScript SDK has a parent property&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-SubtypeSublayer.html#properties-summary" target="_self"&gt;doc&lt;/A&gt;&amp;nbsp;. But I couldn't find a similar property in the .NET Maps SDK.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 17:26:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-parent-from-subtypesublayer/m-p/1649806#M13666</guid>
      <dc:creator>EricLiu</dc:creator>
      <dc:date>2025-09-11T17:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get parent from SubtypeSublayer</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-parent-from-subtypesublayer/m-p/1649823#M13668</link>
      <description>&lt;P&gt;The query operations are on the &lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Mapping.FeatureLayer.FeatureTable.html" target="_self"&gt;FeatureLayer.featureTable&lt;/A&gt; property.&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Data.ArcGISFeatureTable.html" target="_self"&gt;ArcGISFeatureTable&lt;/A&gt;, you can use the Sublayer's subtype code as additional filter in your where clause or use&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/api-reference/api/net/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Data.SubtypeSubtable.html" target="_self"&gt;SubtypeSubtable&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;Whether you're getting SubtypeFeatureLayer from web map or table that supports subtype, you can try the following code. Notice that for "Service Station" subtype (code: 21) on a Pipeline Device there's only 1 feature of this subtype out of 31411 features.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var credential = await AccessTokenCredential.CreateAsync(new Uri("https://sampleserver7.arcgisonline.com/portal/sharing/rest"), "viewer01", "I68VGU^nMurF");
AuthenticationManager.Current.AddCredential(credential);

var geodatabase = new ServiceGeodatabase(new Uri("https://sampleserver7.arcgisonline.com/server/rest/services/UtilityNetwork/NapervilleGasV6/FeatureServer"));
await geodatabase.LoadAsync();

var table = geodatabase.GetTable(0);
var layer = new SubtypeFeatureLayer(table);

await layer.LoadAsync();

var sublayer = layer.SubtypeSublayers.LastOrDefault();
ArgumentNullException.ThrowIfNull(sublayer);

var query = new QueryParameters();
query.WhereClause = $"{table.SubtypeField} = {sublayer.Subtype.Code}";

ArgumentNullException.ThrowIfNull(layer.FeatureTable);
var features = await layer.FeatureTable.QueryFeaturesAsync(query);

var subtypeTable = new SubtypeSubtable(sublayer.Subtype);
table.SubtypeSubtables.Add(subtypeTable);
var subtypeFeatures = await subtypeTable.QueryFeaturesAsync(new QueryParameters() { WhereClause = "1=1" });

var count = await layer.FeatureTable.QueryFeatureCountAsync(new QueryParameters() { WhereClause = "1=1" });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hm, there is no back-reference to the parent layer from SubtypeSublayer though. Can you describe your workflow, how you have access to the sublayer only but not have access to the layer?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 18:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-parent-from-subtypesublayer/m-p/1649823#M13668</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2025-09-11T18:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get parent from SubtypeSublayer</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-parent-from-subtypesublayer/m-p/1649827#M13669</link>
      <description>&lt;P&gt;Thank you for the quick response&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1020"&gt;@JenniferNery&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;In your snippet I see the code has a reference to both the SubtypeSublayer and the SubtypeFeatureLayer. If I only have a reference to the SubtypeSublayer, is it not possible to obtain the SubtypeFeatureLayer it belongs to via a 'parent' property ?&lt;/P&gt;&lt;P&gt;Also comparing to the web SDK. I notice in web, SubtypeSublayer's Id field is a unique string, and a number like '2' as the subtype code. But in the .NET SDK, the Id property is just the subtype code '2'.&lt;/P&gt;&lt;P&gt;I'm trying to either access the SubtypeFeatureLayer through the SubtypeSublayer, or for the SubtypeSublayer to have an unique enough Id for the to search for in the Map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 18:25:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-parent-from-subtypesublayer/m-p/1649827#M13669</guid>
      <dc:creator>EricLiu</dc:creator>
      <dc:date>2025-09-11T18:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to get parent from SubtypeSublayer</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-parent-from-subtypesublayer/m-p/1649888#M13675</link>
      <description>&lt;P&gt;There is currently no way from SubtypeSublayer to get to its parent layer. But if you have a feature from an identify or query, this feature has reference to the table, and the table has reference to the layer it comes from.&lt;/P&gt;&lt;P&gt;As for the SubtypeSublayer.Id, in the Native SDKs this is meant to match the Subtype.code property. If you are using&amp;nbsp;&lt;A href="https://developers.arcgis.com/web-map-specification/objects/search_layer/" target="_blank"&gt;search.layer | Web Map Specification | Esri Developer&lt;/A&gt;, I think there's an optional subLayer property that will match SubtypeSublayer.Id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "id" on this search is a string so it will not match the sublayer. There is however, a SubtypeSublayer.unsupportedJSON property that is deprecated and will be removed in the next release that contains the "id" string. JSON on the left can be web/mobile map, watch window on the right is from map loaded in Native SDK for .NET.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="webmap_search.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/140286i68200475D568471B/image-size/large?v=v2&amp;amp;px=999" role="button" title="webmap_search.png" alt="webmap_search.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 20:30:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/how-to-get-parent-from-subtypesublayer/m-p/1649888#M13675</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2025-09-11T20:30:55Z</dc:date>
    </item>
  </channel>
</rss>

