Skip to content

Item object move() errors for File Geodatabase item when already in the folder but not for a Feature Layer Collection (feature service)) #2496

@Clubdebambos

Description

@Clubdebambos

Describe the bug
The Item object move() method moved an item of content to a specific folders and is supposed to return a JSON message. I have two item objects, one that represents a File Geodatabase and the other a Feature Layer Collection.

When initially move the File Geodatabase to a folder, it works just fine. If I re-run, I get an error: Exception: Item already exists in target folder.

However, if I do the same with a Feature Layer Collection object, I get a success message every time. It doiesnt matter that the item is already in the folder.

I have tested from an ArcGIS Pro Notebook, ArcGIS Online Notebook, and a standalone script

To Reproduce
Steps to reproduce the behavior:

from arcgis.gis import GIS
agol = GIS("home")

gdb_item = agol.content.get("FGDB_ITEM_ID")
flc_item = agol.content.get("FLC_ITEM_ID")

folder = agol.content.folders.get("FOLDER_NAME")

## works once and then fails if already in the folder
gdb_item.move(
    folder = folder
)

## you can run this over and over again without failure
flc_item.move(
    folder = folder
)

error:

Exception: Item already exists in target folder
(Error Code: 500)

Screenshots
If applicable, add screenshots to help explain your problem.

Expected behavior
I expect the move() to act as gracefully for all Item object types without erroring if the item is already in the folder, just like what happens with the FLC item.

Platform (please complete the following information):

  • OS: Windows 11 Home
  • Browser: Chrome/Edge
  • Python API Version: 2.4.2

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

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions