<?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: Working with Local Experiences - portalURL in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/working-with-local-experiences-portalurl/m-p/1526341#M10464</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/760022"&gt;@CS_IBM&lt;/a&gt;&amp;nbsp; Seems your portal or data source (&lt;SPAN&gt;local_exp.datasources)&amp;nbsp;&lt;/SPAN&gt;is not valid&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;. Try with item_mapping = { &lt;SPAN class=""&gt;"dataSource_4"&lt;/SPAN&gt;: { &lt;SPAN class=""&gt;"itemId"&lt;/SPAN&gt; : &lt;SPAN class=""&gt;'f9827ea6779440d196806b84017f0c33'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"portalUrl"&lt;/SPAN&gt; : target.url, } } and validate portal URL . Refer this link for more details&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/guide/experience-builder-workflows/" target="_self"&gt;Experience-builder-workflows&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Aug 2024 10:08:28 GMT</pubDate>
    <dc:creator>AnjulPandey</dc:creator>
    <dc:date>2024-08-23T10:08:28Z</dc:date>
    <item>
      <title>Working with Local Experiences - portalURL</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/working-with-local-experiences-portalurl/m-p/1524791#M10453</link>
      <description>&lt;P&gt;Greetings,&lt;BR /&gt;I am using the ESRI Working with Experience Builder.&lt;BR /&gt;&lt;BR /&gt;I am trying to upload the local_exp (EXB web app) to AGOL.&lt;BR /&gt;Not transfer another EXB from Portal to AGOL.&lt;BR /&gt;&lt;STRONG&gt;Can this be done using new_item = local_exp.upload()??&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;The script is craching at the&amp;nbsp;&lt;STRONG&gt;new_item = local_exp.upload(&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The script is:&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;local_exp = WebExperience(gis = gis, path = local_path1)
#print(local_exp.datasources)

item_mapping = local_exp.datasources

### Target
target = GIS(profile=me)

### Upload
new_item = local_exp.upload(
    gis = target,
    publish = True,
    title = "v3",
    item_mapping = local_exp.datasources,
    auto_remap = True,
)
new_item&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;It throws an error at&amp;nbsp;&amp;nbsp;portalUrl&lt;BR /&gt;&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Users\ci000030\PycharmProjects\Defra_DEV\.venv\DEV\Upload_Local_BusinessLayers.py", line 34, in &amp;lt;module&amp;gt;&lt;BR /&gt;new_item = local_exp.upload(&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\apps\expbuilder\expbuilder.py", line 633, in upload&lt;BR /&gt;url = sources[source]["portalUrl"]&lt;BR /&gt;KeyError: 'portalUrl'&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;url = sources[source]["portalUrl"]&lt;BR /&gt;KeyError: 'portalUrl'&lt;BR /&gt;&lt;BR /&gt;Can anyone assist to assist to find a solution?&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks&lt;BR /&gt;Clive&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 11:56:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/working-with-local-experiences-portalurl/m-p/1524791#M10453</guid>
      <dc:creator>CS_IBM</dc:creator>
      <dc:date>2024-08-21T11:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Local Experiences - portalURL</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/working-with-local-experiences-portalurl/m-p/1526341#M10464</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/760022"&gt;@CS_IBM&lt;/a&gt;&amp;nbsp; Seems your portal or data source (&lt;SPAN&gt;local_exp.datasources)&amp;nbsp;&lt;/SPAN&gt;is not valid&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;. Try with item_mapping = { &lt;SPAN class=""&gt;"dataSource_4"&lt;/SPAN&gt;: { &lt;SPAN class=""&gt;"itemId"&lt;/SPAN&gt; : &lt;SPAN class=""&gt;'f9827ea6779440d196806b84017f0c33'&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"portalUrl"&lt;/SPAN&gt; : target.url, } } and validate portal URL . Refer this link for more details&amp;nbsp;&lt;A href="https://developers.arcgis.com/python/guide/experience-builder-workflows/" target="_self"&gt;Experience-builder-workflows&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 10:08:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/working-with-local-experiences-portalurl/m-p/1526341#M10464</guid>
      <dc:creator>AnjulPandey</dc:creator>
      <dc:date>2024-08-23T10:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Working with Local Experiences - portalURL</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/working-with-local-experiences-portalurl/m-p/1526442#M10465</link>
      <description>&lt;P&gt;Hi Anujal.&lt;BR /&gt;&lt;BR /&gt;I am using the &lt;STRONG&gt;Working with Local Experinces&lt;/STRONG&gt; example.&lt;BR /&gt;I only have one profile (gis = GIS()), not three!!&lt;BR /&gt;&lt;BR /&gt;I updated the item_mapping, and tried 1 and 2.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;1)
item_mapping1 = {
    "dataSource_7":
    {
        "itemId" : '72fca989ae914927a6fcef80c6f51805',
        "portalUrl" : 'https://DEV.maps.arcgis.com'
    }&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;2)
item_mapping1 = {
    "dataSource_7":
    {
        "itemId" : '72fca989ae914927a6fcef80c6f51805',
        "portalUrl" : 'https://DEV.maps.arcgis.com',
        "url" :       'https://services.arcgis.com/DEV/arcgis/rest/services/DEV/FeatureServer'
    }&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;The Python code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;new_item = local_exp.upload(
    gis = gis,
    publish = True,
    title = "Uploaded Local Experience",
    item_mapping = item_mapping1,
    auto_remap = True,
)
new_item&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I still get the same error message for 1 and 2??&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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'&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Any suggestions to resolve this??&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Clive&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 14:32:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/working-with-local-experiences-portalurl/m-p/1526442#M10465</guid>
      <dc:creator>CS_IBM</dc:creator>
      <dc:date>2024-08-23T14:32:00Z</dc:date>
    </item>
  </channel>
</rss>

