<?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: Creating a Group Layer Item in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-a-group-layer-item/m-p/1543731#M10718</link>
    <description>&lt;P&gt;Sorry for the late response, but this seems&amp;nbsp; to work! Thank you very much!&lt;/P&gt;</description>
    <pubDate>Mon, 30 Sep 2024 08:07:26 GMT</pubDate>
    <dc:creator>Desharin</dc:creator>
    <dc:date>2024-09-30T08:07:26Z</dc:date>
    <item>
      <title>Creating a Group Layer Item</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-a-group-layer-item/m-p/1529428#M10481</link>
      <description>&lt;P&gt;I've been trying to add a Group Layer to ArcGIS Online using the Python API, but my attempts have only been partly succesful. Below you'll find some code similar to what I've been doing. I've used the Group Layer spec as shown &lt;A title="Group Layer (GroupLayer)" href="https://developers.arcgis.com/web-map-specification/objects/groupLayer/" target="_blank" rel="noopener"&gt;here.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis import GIS
import json
gis = GIS(url = AGO_URL, username = AGO_USER, password = AGO_PASS)

itemProperties = {
    'type': 'Group Layer',
    'description': 'Some Description',
    'title': 'Some Title',
    'tags': ['Tag1', 'Tag2'],
    'snippet': 'Some Snippet',
    'accessInformation': 'Some Access Information',
    'licenseInfo': 'Some License Info',
    'commentsEnabled': False,
    'access': 'org',
    'text': json.dumps(
        {
            "id": "groupLayer",
            "layerType": "GroupLayer",
            "title": "US Census",
            "layers": [
                {
                    "id": "Census_6999",
                    "title": "Census - states",
                    "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3",
                    "layerType": "ArcGISFeatureLayer"
                },
                {
                    "id": "Census_616",
                    "title": "Census - Detailed Counties",
                    "url": "https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2",
                    "layerType": "ArcGISFeatureLayer"
                }
            ]
        }
    )
}

gis.content.add(
    item_properties = itemProperties,
    thumbnail = 'Some thumbnail url',
    metadata = None,
    owner = None,
    folder = None
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This will successfully add the item as a Group Layer to ArcGIS Online, with title, description, etc. all working. The 2 layers will also show up as layers in the item. However, if I open the item in the Map Viewer, no layers will be shown.&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 14:36:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-a-group-layer-item/m-p/1529428#M10481</guid>
      <dc:creator>Desharin</dc:creator>
      <dc:date>2024-08-29T14:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Group Layer Item</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-a-group-layer-item/m-p/1534039#M10603</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/828492"&gt;@Desharin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Add the following typeKeywords to your itemProperties.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    "typeKeywords": [
        "ArcGIS API for JavaScript",
        "Group Layer",
        "Map"
    ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is also no need for json.dumps in the "text" property.&lt;/P&gt;&lt;P&gt;Let me know if that works for you?&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Glen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 10:54:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-a-group-layer-item/m-p/1534039#M10603</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2024-09-02T10:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Group Layer Item</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-a-group-layer-item/m-p/1543731#M10718</link>
      <description>&lt;P&gt;Sorry for the late response, but this seems&amp;nbsp; to work! Thank you very much!&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2024 08:07:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/creating-a-group-layer-item/m-p/1543731#M10718</guid>
      <dc:creator>Desharin</dc:creator>
      <dc:date>2024-09-30T08:07:26Z</dc:date>
    </item>
  </channel>
</rss>

