<?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 Find layers by querying groupCategories through Portal in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/find-layers-by-querying-groupcategories-through/m-p/1379192#M83595</link>
    <description>&lt;P&gt;Hi,&amp;nbsp; I would like to query our portal for group items by category.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After loading the portal and finding the group by id, I am giving the group to this function as group0:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const getLayers = async (group0: any) =&amp;gt; {
  let queryParams = {
    query: `categories: ["/Categories/CDC Social Vulnerability Index/Theme 1: Socio-economic"]`,
  }
  const { results } = await group0.queryItems(queryParams )
  return results
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried several iterations of this search string.&amp;nbsp; If I am only searching one category level (/Categories/ALICE Households), it works , but if I go into a nested category (like Theme 1 here), it returns all of the layers in the group.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried categories: and groupCategories:, with curly braces, with brackets, with no braces, just a string, with quotes and without.&amp;nbsp; Has anyone had any success fetching layers that have been categorized in a portal group in a nested category schema?&lt;/P&gt;&lt;P&gt;With gratitude,&lt;/P&gt;&lt;P&gt;Michelle&lt;/P&gt;</description>
    <pubDate>Wed, 07 Feb 2024 16:54:55 GMT</pubDate>
    <dc:creator>MichelleStuart</dc:creator>
    <dc:date>2024-02-07T16:54:55Z</dc:date>
    <item>
      <title>Find layers by querying groupCategories through Portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/find-layers-by-querying-groupcategories-through/m-p/1379192#M83595</link>
      <description>&lt;P&gt;Hi,&amp;nbsp; I would like to query our portal for group items by category.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After loading the portal and finding the group by id, I am giving the group to this function as group0:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const getLayers = async (group0: any) =&amp;gt; {
  let queryParams = {
    query: `categories: ["/Categories/CDC Social Vulnerability Index/Theme 1: Socio-economic"]`,
  }
  const { results } = await group0.queryItems(queryParams )
  return results
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried several iterations of this search string.&amp;nbsp; If I am only searching one category level (/Categories/ALICE Households), it works , but if I go into a nested category (like Theme 1 here), it returns all of the layers in the group.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried categories: and groupCategories:, with curly braces, with brackets, with no braces, just a string, with quotes and without.&amp;nbsp; Has anyone had any success fetching layers that have been categorized in a portal group in a nested category schema?&lt;/P&gt;&lt;P&gt;With gratitude,&lt;/P&gt;&lt;P&gt;Michelle&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 16:54:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/find-layers-by-querying-groupcategories-through/m-p/1379192#M83595</guid>
      <dc:creator>MichelleStuart</dc:creator>
      <dc:date>2024-02-07T16:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Find layers by querying groupCategories through Portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/find-layers-by-querying-groupcategories-through/m-p/1380663#M83615</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/471565"&gt;@MichelleStuart&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;Instead of using the query property, have you tried using the PortalQueryParams&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-PortalQueryParams.html#categories" target="_self"&gt;categories&lt;/A&gt; property? This takes a string or an array of strings that can be formatted like so:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;let queryParams = {
  categories: [
    ["/Categories/Trending/New and noteworthy", "/Categories/Basemaps/Reference maps/Test category"]
  ]
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;If attempting to get items in a subcategory, be sure to add those category folders the to full path.&lt;/P&gt;&lt;P&gt;Here's an example CodePen that queries two different categories that contain sub categories:&amp;nbsp;&lt;A href="https://codepen.io/laurenb14/pen/wvOYvWv?editors=1000" target="_blank"&gt;https://codepen.io/laurenb14/pen/wvOYvWv?editors=1000&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 23:49:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/find-layers-by-querying-groupcategories-through/m-p/1380663#M83615</guid>
      <dc:creator>LaurenBoyd</dc:creator>
      <dc:date>2024-02-09T23:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Find layers by querying groupCategories through Portal</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/find-layers-by-querying-groupcategories-through/m-p/1381062#M83623</link>
      <description>&lt;P&gt;Thank you Lauren! This worked.&amp;nbsp; I really appreciate your help.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 15:27:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/find-layers-by-querying-groupcategories-through/m-p/1381062#M83623</guid>
      <dc:creator>MichelleStuart</dc:creator>
      <dc:date>2024-02-12T15:27:28Z</dc:date>
    </item>
  </channel>
</rss>

