<?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: Item Sharing to Groups through the new Sharing Manager Module 2.4 in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/item-sharing-to-groups-through-the-new-sharing/m-p/1562858#M10913</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10527"&gt;@JakeSkinner&lt;/a&gt;&amp;nbsp;- yeah it still doesn't like it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;or like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;org_group = ['dc0c980751374bf796f3965b720154ba']
portItem_grp.remove(group=org_group)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it does like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;org_group = 'dc0c980751374bf796f3965b720154ba'
portItem_grp.remove(org_group)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This 3rd syntax removed the layer from the group.&amp;nbsp;&lt;/P&gt;&lt;P&gt;More than one group works like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;org_group = 'dc0c980751374bf796f3965b720154ba,da28c73ec47344df87290ed58e09f533'
portItem_grp.add(org_group)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2024 21:56:21 GMT</pubDate>
    <dc:creator>DavidColey</dc:creator>
    <dc:date>2024-11-26T21:56:21Z</dc:date>
    <item>
      <title>Item Sharing to Groups through the new Sharing Manager Module 2.4</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/item-sharing-to-groups-through-the-new-sharing/m-p/1562700#M10910</link>
      <description>&lt;P&gt;Hi - I am trying to use the new Sharing Module at 2.4 like this (I still like to use the IDLE for testing):&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.gis._impl._content_manager import SharingLevel
gis = GIS("...myorg.net/portal", "myUsername", "myPassword", verify_cert=False)

try:
    portItems = gis.content.search(query="owner:myUsername", item_type="Feature Layer", sort_field="title", sort_order="asc", max_items=5000)
    for portItem in portItems:
        if (portItem.title == "SchoolBoardDistrict4"):
            portItem_sharing = portItem.sharing
            portItem_grp = portItem_sharing.groups
            type(portItem_grp)
            print(type(portItem_grp))
	# I am getting the correct type
	    &amp;lt;class 'arcgis.gis._impl._content_manager.sharing.api.SharingGroupManager'&amp;gt;

            org_group = ["Planning Layers Group"]
	# This works
	    portItem_sharing.sharing_level = SharingLevel.EVERYONE
	
            #portItem_grp.add(group=org_group)
            portItem_grp.remove(org_group)
	# won't remove the item from the group
            portItem_grp.list()
            print(portItem_grp.list())
	# [&amp;lt;Group title:"Planning Layers Group" owner:dmcoley_portal&amp;gt;]

except Exception:
    # If an error occurred, print line number and error message
    import traceback, sys
    tb = sys.exc_info()[2]
    e = sys.exc_info()[1]
    print(e.args[0])
    print ("Line %i" % tb.tb_lineno)
    message = message + "\n" + "Line %i" % tb.tb_lineno
    message = message + "\n" + str(e)&lt;/LI-CODE&gt;&lt;P&gt;Based on this sample from the Sharing Group Manager in the API reference:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;# Usage example:
&lt;SPAN class=""&gt;&amp;gt;&amp;gt;&amp;gt; &lt;SPAN class=""&gt;from &lt;SPAN class=""&gt;arcgis.gis &lt;SPAN class=""&gt;import &lt;SPAN class=""&gt;GIS
&lt;SPAN class=""&gt;&amp;gt;&amp;gt;&amp;gt; &lt;SPAN class=""&gt;gis &lt;SPAN class=""&gt;= &lt;SPAN class=""&gt;GIS&lt;SPAN class=""&gt;(&lt;SPAN class=""&gt;profile&lt;SPAN class=""&gt;=&lt;SPAN class=""&gt;"your_organization_profile"&lt;SPAN class=""&gt;)

&lt;SPAN class=""&gt;&amp;gt;&amp;gt;&amp;gt; &lt;SPAN class=""&gt;org_item &lt;SPAN class=""&gt;= &lt;SPAN class=""&gt;gis&lt;SPAN class=""&gt;.&lt;SPAN class=""&gt;content&lt;SPAN class=""&gt;.&lt;SPAN class=""&gt;get&lt;SPAN class=""&gt;(&lt;SPAN class=""&gt;"&amp;lt;item_id&amp;gt;"&lt;SPAN class=""&gt;)
&lt;SPAN class=""&gt;&amp;gt;&amp;gt;&amp;gt; &lt;SPAN class=""&gt;org_group &lt;SPAN class=""&gt;= &lt;SPAN class=""&gt;gis&lt;SPAN class=""&gt;.&lt;SPAN class=""&gt;groups&lt;SPAN class=""&gt;.&lt;SPAN class=""&gt;search&lt;SPAN class=""&gt;(&lt;SPAN class=""&gt;"Storm Data Group"&lt;SPAN class=""&gt;)[&lt;SPAN class=""&gt;0&lt;SPAN class=""&gt;]

&lt;SPAN class=""&gt;&amp;gt;&amp;gt;&amp;gt; &lt;SPAN class=""&gt;item_sharing_mgr &lt;SPAN class=""&gt;= &lt;SPAN class=""&gt;org_item&lt;SPAN class=""&gt;.&lt;SPAN class=""&gt;sharing
&lt;SPAN class=""&gt;&amp;gt;&amp;gt;&amp;gt; &lt;SPAN class=""&gt;item_grp_sharing_mgr &lt;SPAN class=""&gt;= &lt;SPAN class=""&gt;item_sharing_mgr&lt;SPAN class=""&gt;.&lt;SPAN class=""&gt;groups
&lt;SPAN class=""&gt;&amp;gt;&amp;gt;&amp;gt; &lt;SPAN class=""&gt;item_grp_sharing_mgr&lt;SPAN class=""&gt;.&lt;SPAN class=""&gt;list&lt;SPAN class=""&gt;()
&lt;SPAN class=""&gt;[]

&lt;SPAN class=""&gt;&amp;gt;&amp;gt;&amp;gt; &lt;SPAN class=""&gt;item_grp_sharing_mgr&lt;SPAN class=""&gt;.&lt;SPAN class=""&gt;add&lt;SPAN class=""&gt;(&lt;SPAN class=""&gt;group&lt;SPAN class=""&gt;=&lt;SPAN class=""&gt;org_group&lt;SPAN class=""&gt;)
&lt;SPAN class=""&gt;True

&lt;SPAN class=""&gt;&amp;gt;&amp;gt;&amp;gt; &lt;SPAN class=""&gt;item_grp_sharing_mgr&lt;SPAN class=""&gt;.&lt;SPAN class=""&gt;list&lt;SPAN class=""&gt;()
&lt;SPAN class=""&gt;[&lt;SPAN class=""&gt;&amp;lt;&lt;SPAN class=""&gt;Group &lt;SPAN class=""&gt;title&lt;SPAN class=""&gt;:&lt;SPAN class=""&gt;"Storm Data Group" &lt;SPAN class=""&gt;owner&lt;SPAN class=""&gt;:&lt;SPAN class=""&gt;web_gis_user1&lt;SPAN class=""&gt;&amp;gt;&lt;SPAN class=""&gt;]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;It just doesn't seem to want to take the org_group object&amp;nbsp; I am setting up.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any Ideas?&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/363906"&gt;@jcarlson&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10527"&gt;@JakeSkinner&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 16:34:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/item-sharing-to-groups-through-the-new-sharing/m-p/1562700#M10910</guid>
      <dc:creator>DavidColey</dc:creator>
      <dc:date>2024-11-26T16:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Item Sharing to Groups through the new Sharing Manager Module 2.4</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/item-sharing-to-groups-through-the-new-sharing/m-p/1562721#M10912</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10568"&gt;@DavidColey&lt;/a&gt;&amp;nbsp;try changing the group name to the group ID:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;org_group = ["Planning Layers Group"]&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ex:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;org_group = ['80d1821b9af64b9b9fd81dc0d4c8d991']&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 17:25:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/item-sharing-to-groups-through-the-new-sharing/m-p/1562721#M10912</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2024-11-26T17:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Item Sharing to Groups through the new Sharing Manager Module 2.4</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/item-sharing-to-groups-through-the-new-sharing/m-p/1562858#M10913</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10527"&gt;@JakeSkinner&lt;/a&gt;&amp;nbsp;- yeah it still doesn't like it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;or like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;org_group = ['dc0c980751374bf796f3965b720154ba']
portItem_grp.remove(group=org_group)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it does like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;org_group = 'dc0c980751374bf796f3965b720154ba'
portItem_grp.remove(org_group)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This 3rd syntax removed the layer from the group.&amp;nbsp;&lt;/P&gt;&lt;P&gt;More than one group works like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;org_group = 'dc0c980751374bf796f3965b720154ba,da28c73ec47344df87290ed58e09f533'
portItem_grp.add(org_group)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 21:56:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/item-sharing-to-groups-through-the-new-sharing/m-p/1562858#M10913</guid>
      <dc:creator>DavidColey</dc:creator>
      <dc:date>2024-11-26T21:56:21Z</dc:date>
    </item>
  </channel>
</rss>

