<?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: How to return derived out put from 'Share Package' in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1238866#M66233</link>
    <description>&lt;P&gt;Hello, coming across this issue today, below are my findings.&lt;/P&gt;&lt;P&gt;I did a print(result.getOutput(0)),&amp;nbsp;... print(result.getOutput(2)) and it looks like this for me:&lt;/P&gt;&lt;P&gt;0: true&lt;BR /&gt;1: {"publishStatus":"completed","publishMessage":"","publishResult":{"type":"Map Service","serviceurl":"&lt;A href="https://my.domain.org/server/rest/services/Hosted/mycachename/MapServer" target="_blank"&gt;https://my.domain.org/server/rest/services/Hosted/mycachename/MapServer&lt;/A&gt;","serviceItemId":"123HostedTileLayerItemID4567890A","jobId":"123JobID4567890ABCDEFGHIJKLMNOPQR"}}&lt;BR /&gt;2: 123TilePackageItemID4567890ABCDE&lt;/P&gt;&lt;P&gt;I was after the Item IDs of the tile package and the published hosted layer, so this worked for me:&lt;/P&gt;&lt;P&gt;thisdict = json.loads(result.getOutput(1))&lt;BR /&gt;print("Tile Layer (hosted) Item ID on Portal: thisdict["publishResult"]["serviceItemId"])&lt;BR /&gt;print("Tile Package (tpkx) Item ID on Portal: result.getOutput(2))&lt;/P&gt;</description>
    <pubDate>Wed, 07 Dec 2022 19:33:25 GMT</pubDate>
    <dc:creator>KC</dc:creator>
    <dc:date>2022-12-07T19:33:25Z</dc:date>
    <item>
      <title>How to return derived out put from 'Share Package'</title>
      <link>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1196623#M65076</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am curious to know how I might be able to return this output as a string. I am able to publish the tile package but, I am a bit confused on how to access this 'Derived Output'. I have tried "return&amp;nbsp;&lt;SPAN&gt;publish_results" as well as "print(publish_results)" and got errors back. I will attach a link&amp;nbsp;of the tool in question.&amp;nbsp;&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/share-package.htm#GUID-D54F56F2-7D8B-4AF8-A86D-1C7855F3A58A" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/share-package.htm#GUID-D54F56F2-7D8B-4AF8-A86D-1C7855F3A58A&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you in advance&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2022 23:47:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1196623#M65076</guid>
      <dc:creator>tsmith4517</dc:creator>
      <dc:date>2022-07-27T23:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to return derived out put from 'Share Package'</title>
      <link>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1196724#M65077</link>
      <description>&lt;P&gt;try assigning the method to a variable and then accessing the output attributes like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;result = arcpy.management.SharePackage(r"C:\states.lpkx", "", "", 
                              "My Summary", "tag1, tag2", "My Credits", 
                              "MYGROUPS", "My Group")

print(result.publish_results) # or print(result['publish_results'])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 13:16:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1196724#M65077</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-07-28T13:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to return derived out put from 'Share Package'</title>
      <link>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1196812#M65085</link>
      <description>&lt;P&gt;Jeff, Thank you for the response, unfortunately I am getting an error kicked back. I attached an image of my code and error message. Any ideas of what I am doing wrong?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 15:29:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1196812#M65085</guid>
      <dc:creator>tsmith4517</dc:creator>
      <dc:date>2022-07-28T15:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to return derived out put from 'Share Package'</title>
      <link>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1196840#M65088</link>
      <description>&lt;P&gt;You could try&lt;/P&gt;&lt;LI-CODE lang="python"&gt;print(result)
#or
print(result['publish_results'])&lt;/LI-CODE&gt;&lt;P&gt;or if you can look at the Results object in the debugger to see its structure.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 15:48:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1196840#M65088</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-07-28T15:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to return derived out put from 'Share Package'</title>
      <link>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1197159#M65090</link>
      <description>&lt;P&gt;print(result) returned a Boolean and print(result['publish_results']) returned the same error above&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 22:14:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1197159#M65090</guid>
      <dc:creator>tsmith4517</dc:creator>
      <dc:date>2022-07-28T22:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to return derived out put from 'Share Package'</title>
      <link>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1197305#M65093</link>
      <description>&lt;P&gt;Seems that there is a disconnect in the documentation and the tool's derived output.&amp;nbsp; Looking at the result in the debugger, there isn't any published result. "&lt;EM&gt;&lt;SPAN&gt;JSON response containing the service URL and portal item ID of the web layer.&lt;/SPAN&gt;&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-07-29 054049.png" style="width: 566px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/47209i7E7AE6C4E113076A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-07-29 054049.png" alt="Screenshot 2022-07-29 054049.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;if you use getOutput(2) on the result object, it returns the item id:&lt;/P&gt;&lt;PRE&gt;msg2 = result.getOutput(&lt;SPAN&gt;2&lt;/SPAN&gt;)&lt;BR /&gt;...&lt;BR /&gt;'1s71a2emadethisidupea250c748er'&lt;/PRE&gt;&lt;P&gt;which can be used to create/ reference the item in portal:&lt;/P&gt;&lt;P data-unlink="true"&gt;https://domain.com/portal/home/item.html?id=msg2&lt;/P&gt;&lt;P&gt;Maybe that is what they meant?&amp;nbsp; Wouldn't hurt to open a case with esri.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 11:57:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1197305#M65093</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-07-29T11:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to return derived out put from 'Share Package'</title>
      <link>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1238866#M66233</link>
      <description>&lt;P&gt;Hello, coming across this issue today, below are my findings.&lt;/P&gt;&lt;P&gt;I did a print(result.getOutput(0)),&amp;nbsp;... print(result.getOutput(2)) and it looks like this for me:&lt;/P&gt;&lt;P&gt;0: true&lt;BR /&gt;1: {"publishStatus":"completed","publishMessage":"","publishResult":{"type":"Map Service","serviceurl":"&lt;A href="https://my.domain.org/server/rest/services/Hosted/mycachename/MapServer" target="_blank"&gt;https://my.domain.org/server/rest/services/Hosted/mycachename/MapServer&lt;/A&gt;","serviceItemId":"123HostedTileLayerItemID4567890A","jobId":"123JobID4567890ABCDEFGHIJKLMNOPQR"}}&lt;BR /&gt;2: 123TilePackageItemID4567890ABCDE&lt;/P&gt;&lt;P&gt;I was after the Item IDs of the tile package and the published hosted layer, so this worked for me:&lt;/P&gt;&lt;P&gt;thisdict = json.loads(result.getOutput(1))&lt;BR /&gt;print("Tile Layer (hosted) Item ID on Portal: thisdict["publishResult"]["serviceItemId"])&lt;BR /&gt;print("Tile Package (tpkx) Item ID on Portal: result.getOutput(2))&lt;/P&gt;</description>
      <pubDate>Wed, 07 Dec 2022 19:33:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-return-derived-out-put-from-share-package/m-p/1238866#M66233</guid>
      <dc:creator>KC</dc:creator>
      <dc:date>2022-12-07T19:33:25Z</dc:date>
    </item>
  </channel>
</rss>

