Error when moving content from root directory

996
1
Jump to solution
12-19-2017 11:21 AM
ChrisAdams
Esri Contributor

I am trying to move Portal items from the root directory to a new folder I create. This works when content is stored in a folder I already created but not from the root/home directory under MY CONTENT.

The docs say "You can move content out of folders to root by calling the move() method and specifying / as folder name"

This is the code:

for folder in folders:
    folderitems = adminuser.items(folder= '/')
    for item in folderitems:
        item.move(folder= 'New Folder')

This is the error:

ValueError: Could not locate the folder: /. Please verify that this folder exists and try again.

0 Kudos
1 Solution

Accepted Solutions
ChrisAdams
Esri Contributor

The answer was found in the help:

http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.toc.html?highlight=items#arcgis.gis.U...

"For content in the root folder, use the default value of None for the folder argument.  "

This can be written as:

folderitems = adminuser.items()

View solution in original post

1 Reply
ChrisAdams
Esri Contributor

The answer was found in the help:

http://esri.github.io/arcgis-python-api/apidoc/html/arcgis.gis.toc.html?highlight=items#arcgis.gis.U...

"For content in the root folder, use the default value of None for the folder argument.  "

This can be written as:

folderitems = adminuser.items()