<?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: arcpy - sharing and allowExporting settings not working in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-sharing-and-allowexporting-settings-not/m-p/1181158#M64739</link>
    <description>&lt;P&gt;Marco - thanks for posting this. This is pretty much the solution I came up with - I should have posted this.&lt;/P&gt;&lt;P&gt;It's super annoying that arcpy has this setting, but it doesn't work, so you have to use a different API to complete the task. It's even more annoying that when publishing with arcpy, you don't get back the item ID (at least I haven't figured that out yet), so you have to go search for the item you just created.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jun 2022 16:49:44 GMT</pubDate>
    <dc:creator>davedoesgis</dc:creator>
    <dc:date>2022-06-08T16:49:44Z</dc:date>
    <item>
      <title>arcpy - sharing and allowExporting settings not working</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-sharing-and-allowexporting-settings-not/m-p/1066148#M61321</link>
      <description>&lt;P&gt;I am publishing a local feature class in arcpy (in ArcGIS Pro) to a Portal hosted feature layer. Some of the settings are not coming through per the documentation. I am following &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/sharing/featuresharingdraft-class.htm" target="_blank" rel="noopener"&gt;the first code sample in the help&lt;/A&gt; almost verbatim (create sharing draft, export to service definition draft, stage service, upload service definition).&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the sharing draft, I set it to allow exporting like this:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; sharing_draft.allowExporting = True&lt;/PRE&gt;&lt;P&gt;I create the feature service via this command:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;arcpy.server.UploadServiceDefinition(&lt;BR /&gt;    in_sd_file = str(sd_file), &lt;BR /&gt;    in_server = arcpy.GetActivePortalURL(), &lt;BR /&gt;    in_organization='&lt;FONT color="#FF0000"&gt;SHARE_ORGANIZATION&lt;/FONT&gt;', &lt;BR /&gt;    in_groups = &lt;FONT color="#FF0000"&gt;['&amp;lt;Group1 name&amp;gt;', '&amp;lt;Group2 name&amp;gt;']&lt;BR /&gt;&lt;FONT color="#000000"&gt;)&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I look at the item's page, it is only shared at the owner level (should be shared to the organization) and not shared with any groups:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_0-1623180401000.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/15439i5D52BADC29466D4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dcafdg_0-1623180401000.png" alt="dcafdg_0-1623180401000.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After it finishes, the settings page shows allow export disabled. I would also love to know how to enable sync, if possible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dcafdg_1-1623180446028.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/15440iD307D58290DDD8F5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dcafdg_1-1623180446028.png" alt="dcafdg_1-1623180446028.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I think some/all of this can be done in the arcgis API, but I'm already using arcpy, so I'd like to keep going with that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: Same outcome whether creating a new hosted feature layer&amp;nbsp;or overwriting an existing one.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 19:34:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-sharing-and-allowexporting-settings-not/m-p/1066148#M61321</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2021-06-08T19:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy - sharing and allowExporting settings not working</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-sharing-and-allowexporting-settings-not/m-p/1180562#M64718</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;maybe a bit late for this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding the download option not active, I had a similar issue and I used the following code to enable it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;search_results = gis.content.search('title: '+service+"'", 'Feature Layer')&lt;/P&gt;&lt;P&gt;item = search_results[0]&lt;/P&gt;&lt;P&gt;print(item)&lt;/P&gt;&lt;P&gt;flc = FeatureLayerCollection.fromitem(item)&lt;/P&gt;&lt;P&gt;update_dict = {'capabilities':'Query,Extract,Sync'}&lt;/P&gt;&lt;P&gt;flc.manager.update_definition(update_dict)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 11:34:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-sharing-and-allowexporting-settings-not/m-p/1180562#M64718</guid>
      <dc:creator>MarcoPizzolato</dc:creator>
      <dc:date>2022-06-07T11:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy - sharing and allowExporting settings not working</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-sharing-and-allowexporting-settings-not/m-p/1181158#M64739</link>
      <description>&lt;P&gt;Marco - thanks for posting this. This is pretty much the solution I came up with - I should have posted this.&lt;/P&gt;&lt;P&gt;It's super annoying that arcpy has this setting, but it doesn't work, so you have to use a different API to complete the task. It's even more annoying that when publishing with arcpy, you don't get back the item ID (at least I haven't figured that out yet), so you have to go search for the item you just created.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2022 16:49:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-sharing-and-allowexporting-settings-not/m-p/1181158#M64739</guid>
      <dc:creator>davedoesgis</dc:creator>
      <dc:date>2022-06-08T16:49:44Z</dc:date>
    </item>
  </channel>
</rss>

