I have a Web Experience in ExB DevEd that includes a custom widget (Simple sample). I want to push that Experience to ExB AGOL and for it to include the custom widget. According to the Python API documentation (https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.expbuilder.html#webexperience) this is possible (and supported!) with the upload() method on the WebExperience class.

The code to do this:
from arcgis.apps.expbuilder import WebExperience
from arcgis.gis import GIS
print("STARTING")
gis = GIS("", "", "")
# Point to the config.json from your Dev Edition download folder
# (or, in API v2.4.0+, the path to the project folder itself)
local_exp = WebExperience(gis=gis, path=r"C:\Path\to\server\public\apps\0") #\config.json#")
new_item = local_exp.upload(
gis=gis,
publish=True,
title="My Uploaded Experience",
# widget_mapping={"my-widget":"my-widget"},
auto_remap=True # auto-matches datasources by name/type in target org
)
print("ALL DONE. BOOM!")With the Experience uploaded to the AGOL portal (script executes successful), when I try to view the experience I get a blank screen. Looking at the developer tools I find the issue:
Load app config error. TypeError: Cannot read properties of undefined (reading 'folderUrl'): This is specific to the custom widget (simple)

A thorough inventory of the Experience application content and artifacts does not reveal 'folderUrl' in any of the source items.
If you know the how and why of ‘folderUrl’ and how I can control it, please post here. TIA