Select to view content in your preferred language

Webmap not appearing in cloned storymap?

228
2
06-10-2024 05:02 PM
Labels (3)
KimVoros
New Contributor

Hello,

I successfully cloned my storymap from one organization to another, including an online webmap referenced in a sidecar. However, the cloned webmap does not appear within the sidecar.

I published a version of the storymap for reference. The sidecar section of the site is called 'Project Schools' and the first, blank section is where the web map should be appearing. The second section of the sidecar shows the webmap that fails to appear in the first section of the sidecar. 

I've done the following and still am unable to find the problem:

  • recloned the whole storymap, to confirm it was not a transfer issue
  • was able to view the entire transferred webmap successfully after turning off public sharing of the 'source' storymap
  • successfully added a new reference to the web map and retained it as proof of concept in the sidecar
  • used ArcGIS Online assistant beta to confirm that the web map item ID was correct

I am using ArcGIS Online and used the Python API to make the transfer. I am relatively new to python, so I could have missed something simple.

Thank you in advance for any insight,

 

Kim

 

Storymap: San Bernardino County Safe Routes to School Program (arcgis.com)

Tags (3)
0 Kudos
2 Replies
ThePreatorian
Esri Contributor

@KimVoros Hi Kim, welcome to the wonderful world of the esri python api.

I poked around a bit with the clone_items method and I believe I found the root cause of the issue you are running into. 

Some references are not updating correctly in the new storymap item. Hopefully there will be a fix for this in the future.

In the mean time I have this work around code for you to try out

new_items = other_gis_org.content.clone_items(
    [items_to_clone])

import json
for item in new_items:
    if item.type == "StoryMap":
        new_storymap = StoryMap(item=item)
        new_data = new_storymap._item.get_data()
        new_storymap._item.resources.remove("published_data.json")
        new_storymap._item.resources.add(file_name="published_data.json", text=new_data)
        draft_id = [typeKeyword[18:] for typeKeyword in new_storymap._item.typeKeywords if "smdraftresourceid" in typeKeyword][0]
        new_storymap._item.resources.remove(draft_id)
        new_storymap._item.resources.add(file_name=draft_id, text=new_data)
        new_storymap._item.update(data=json.dumps(new_data))
        print(f"StoryMap {item.title} cloned and updated")
0 Kudos
ThePreatorian
Esri Contributor

Realised I did not include the import statement that needs to be included at the top of the code above

from arcgis.apps.storymap.story import StoryMap



0 Kudos