<?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>idea Add all layers and tables from an item object with the content.add() in ArcGIS API for Python Ideas</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/add-all-layers-and-tables-from-an-item-object-with/idi-p/1600818</link>
    <description>&lt;P&gt;Please update the API to enable adding all Layers and Tables at once.&lt;/P&gt;&lt;P&gt;As of the ArcGIS API for Python version 2.4.0 and the introduction of the MapContent add() method, you can no longer add an item object that contains a Feature Layer and a Table. Below, I attempt to add a Feature Service to the Map that contains one Feature Layer and one Table.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;"""Access the Feature Service"""
niah_fs_item = agol.content.get("WM_ITEM_ID") # NIAH

"""Attempt to add the Feature Service with a Feature Layer and Table"""
webmap.content.add(
    item = niah_fs_item # this will fail!
)&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ValueError:&amp;nbsp;Cannot&amp;nbsp;add&amp;nbsp;a&amp;nbsp;group&amp;nbsp;layer&amp;nbsp;with&amp;nbsp;tables&amp;nbsp;to&amp;nbsp;the&amp;nbsp;map.&amp;nbsp;Please&amp;nbsp;add&amp;nbsp;the&amp;nbsp;layers&amp;nbsp;individually&amp;nbsp;or&amp;nbsp;as&amp;nbsp;a&amp;nbsp;list&amp;nbsp;to&amp;nbsp;the&amp;nbsp;add&amp;nbsp;method.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clubdebambos_0-1743425926741.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/129015iB96013B3463F6A55/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clubdebambos_0-1743425926741.png" alt="Clubdebambos_0-1743425926741.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2.3.0 did this just fine. Now I have to add Feature Layers and Tables separately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 31 Mar 2025 13:02:55 GMT</pubDate>
    <dc:creator>Clubdebambos</dc:creator>
    <dc:date>2025-03-31T13:02:55Z</dc:date>
    <item>
      <title>Add all layers and tables from an item object with the content.add()</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-ideas/add-all-layers-and-tables-from-an-item-object-with/idi-p/1600818</link>
      <description>&lt;P&gt;Please update the API to enable adding all Layers and Tables at once.&lt;/P&gt;&lt;P&gt;As of the ArcGIS API for Python version 2.4.0 and the introduction of the MapContent add() method, you can no longer add an item object that contains a Feature Layer and a Table. Below, I attempt to add a Feature Service to the Map that contains one Feature Layer and one Table.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;"""Access the Feature Service"""
niah_fs_item = agol.content.get("WM_ITEM_ID") # NIAH

"""Attempt to add the Feature Service with a Feature Layer and Table"""
webmap.content.add(
    item = niah_fs_item # this will fail!
)&lt;/LI-CODE&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ValueError:&amp;nbsp;Cannot&amp;nbsp;add&amp;nbsp;a&amp;nbsp;group&amp;nbsp;layer&amp;nbsp;with&amp;nbsp;tables&amp;nbsp;to&amp;nbsp;the&amp;nbsp;map.&amp;nbsp;Please&amp;nbsp;add&amp;nbsp;the&amp;nbsp;layers&amp;nbsp;individually&amp;nbsp;or&amp;nbsp;as&amp;nbsp;a&amp;nbsp;list&amp;nbsp;to&amp;nbsp;the&amp;nbsp;add&amp;nbsp;method.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Clubdebambos_0-1743425926741.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/129015iB96013B3463F6A55/image-size/large?v=v2&amp;amp;px=999" role="button" title="Clubdebambos_0-1743425926741.png" alt="Clubdebambos_0-1743425926741.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2.3.0 did this just fine. Now I have to add Feature Layers and Tables separately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Mar 2025 13:02:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-ideas/add-all-layers-and-tables-from-an-item-object-with/idi-p/1600818</guid>
      <dc:creator>Clubdebambos</dc:creator>
      <dc:date>2025-03-31T13:02:55Z</dc:date>
    </item>
  </channel>
</rss>

