arcgis-python-api icon indicating copy to clipboard operation
arcgis-python-api copied to clipboard

local_exp.upload() function fails to upload a EXB file

Open Clives-online opened this issue 1 year ago • 0 comments

Describe the bug The new_item = local_exp.upload() function fails to upload a EXB file (local) << unzipped.

To Reproduce Steps to reproduce the behavior:

<ilocal_exp = WebExperience(gis = gis, path = local_path1)
#print(local_exp.datasources)

url = 'https://services.arcgis.com/abc/arcgis/rest/services/DEV/FeatureServer/0'
portalURL = 'https://d.maps.arcgis.com'


item_mapping1 = {
    "widget_48_output_config_1":
    {
        "itemId" : 'a8bdfb6783c64ab4bfac66dba8b278ed',
        "portalUrl" : 'https://experience.arcgis.com/experience/abc',
    }
}


#item_mapping = item_mapping1
#print(item_mapping)

### Target
target = GIS(profile=me)


### Upload
new_item = local_exp.upload(
    gis = target,
    publish = True,
    title = "Business-Layers-v3",
    item_mapping = item_mapping1,
    auto_remap = True,
)
new_item>

error:

<Traceback (most recent call last):
  File "C:\Users\ci000030\PycharmProjects\DEV\.venv\DEV\Upload_Local_BusinessLayers.py", line 49, in <module>
    new_item = local_exp.upload(
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\apps\expbuilder\expbuilder.py", line 633, in upload
    url = sources[source]["portalUrl"]
KeyError: 'portalUrl'>

Screenshots

Expected behavior I expect the EXB Web App file content to be uploaded to AGOL. I expect the EXB Web App file and content to be Published to AGOL

Platform (please complete the following information):

  • OS:windows 10
  • Browser: Edge
  • Python API Version 2.2.0.1

Additional context Add any other context about the problem here, attachments etc.

Clives-online avatar Aug 21 '24 16:08 Clives-online