<?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: Published web layers from script not creating data object for popups, etc. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/published-web-layers-from-script-not-creating-data/m-p/1371151#M69678</link>
    <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/223124"&gt;@CassKalinski&lt;/a&gt;&amp;nbsp;, I am running into the exact same issue, even in ArcGIS pro 3.2.1. Its very frustrating when you are trying to standardize publishing with automation.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Our current workaround, is if its a new service, publish from ArcGIS Pro directly (it will create data.json, that was missing from your screenshot). Then any update or changes from aprx, I run the overwrite service and change the data.json myself using the Portal Rest API.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2024 18:37:02 GMT</pubDate>
    <dc:creator>ClangDevGuy</dc:creator>
    <dc:date>2024-01-17T18:37:02Z</dc:date>
    <item>
      <title>Published web layers from script not creating data object for popups, etc.</title>
      <link>https://community.esri.com/t5/python-questions/published-web-layers-from-script-not-creating-data/m-p/1278284#M67413</link>
      <description>&lt;P&gt;Problem:&lt;BR /&gt;When using arcpy to publish a web layer/feature layer collection, I am not getting the item.get_data() object that lists the fields, pop-ups, etc.&lt;BR /&gt;Code follows.&lt;/P&gt;&lt;P&gt;Scenario:&lt;BR /&gt;* Have a set of maps in a Pro project, each having multiple layers. Pro v3.0.3&lt;BR /&gt;* Script loops through these, publishing each of these as web layer (feature layer collection)&lt;BR /&gt;* Publish script runs fine, except that I do not get the data object (i.e. 'text' in item properties I believe) created when I look at it in Assistant.&lt;BR /&gt;* If I publish the same map manually from Pro, I get the data object. (Share &amp;gt; Publish web layer)&lt;/P&gt;&lt;P&gt;Need this object (specifically, the layers) for the remainder of the scripting that updates popups, field settings, etc. Item object looks as expected except for missing the item.get_data() object. The JSON in the REST end point looks as expected. Feature layer collection functions as expected.&lt;/P&gt;&lt;P&gt;What am I missing? Is there a subsequent step needed to manifest this object in the item?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;aprx_file = 'path/to/file.aprx'
folder_name = 'Existing_folder_name'
group_name = 'Some group name'
server_type = 'HOSTING_SERVER'


aprx = arcpy.mp.ArcGISProject(aprx_file)
map_objects = aprx.listMaps()

for map_object in map_objects:

    sddraft = map_object.getWebLayerSharingDraft(
        server_type = server_type,
        service_type = 'FEATURE',
        service_name = map_object.name
        )
        
    sddraft.exportToSDDraft(sddraft_filename)   

    arcpy.server.StageService(sddraft_filename, sd_filename)

    arcpy.server.UploadServiceDefinition(
        in_sd_file = sd_filename,
        in_server = server_type,
        in_service_name = service_name,
        in_folder_type = 'EXISTING',
        in_folder = folder_name,
        in_override = 'OVERRIDE_DEFINITION',
        in_public = "PRIVATE",
        in_organization = 'NO_SHARE_ORGANIZATION',
        in_groups = [group_name])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CassKalinski_0-1681397032001.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67887i80602FA9732E86CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CassKalinski_0-1681397032001.png" alt="CassKalinski_0-1681397032001.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CassKalinski_1-1681397119585.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67888i3339EEB367B1595E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CassKalinski_1-1681397119585.png" alt="CassKalinski_1-1681397119585.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 14:46:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/published-web-layers-from-script-not-creating-data/m-p/1278284#M67413</guid>
      <dc:creator>CassKalinski</dc:creator>
      <dc:date>2023-04-13T14:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Published web layers from script not creating data object for popups, etc.</title>
      <link>https://community.esri.com/t5/python-questions/published-web-layers-from-script-not-creating-data/m-p/1313250#M68282</link>
      <description>&lt;P&gt;I'm experiencing the same issue with Pro 2.9, and the best reason I can find so far is that there appears to be a bug in the Python API where popups are ignored when publishing (&lt;A href="https://support.esri.com/en-us/bug/popups-do-not-maintain-their-configuration-in-arcgis-on-bug-000139253" target="_self"&gt;BUG-000139253&lt;/A&gt;). There's a code sample on &lt;A href="https://community.esri.com/t5/arcgis-pro-questions/popup-information-not-published-to-arcgis/m-p/1258748/highlight/true#M65590" target="_self"&gt;this post&lt;/A&gt; that'll get you most of the way there towards building the schema, then you just need to call item.update() with an object where "text" is set to the popup schema. One caveat I discovered today is that it doesn't work if fields haven't been specifically configured.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 20:20:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/published-web-layers-from-script-not-creating-data/m-p/1313250#M68282</guid>
      <dc:creator>tempStephenRhea_NV5</dc:creator>
      <dc:date>2023-07-28T20:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Published web layers from script not creating data object for popups, etc.</title>
      <link>https://community.esri.com/t5/python-questions/published-web-layers-from-script-not-creating-data/m-p/1371151#M69678</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/223124"&gt;@CassKalinski&lt;/a&gt;&amp;nbsp;, I am running into the exact same issue, even in ArcGIS pro 3.2.1. Its very frustrating when you are trying to standardize publishing with automation.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Our current workaround, is if its a new service, publish from ArcGIS Pro directly (it will create data.json, that was missing from your screenshot). Then any update or changes from aprx, I run the overwrite service and change the data.json myself using the Portal Rest API.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 18:37:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/published-web-layers-from-script-not-creating-data/m-p/1371151#M69678</guid>
      <dc:creator>ClangDevGuy</dc:creator>
      <dc:date>2024-01-17T18:37:02Z</dc:date>
    </item>
  </channel>
</rss>

