Hi,
Is there a way to clone item (hosted feature layer) with a user defined name or title for new hosted feature layer?
I did look the python api clone module , it dosen't list any naming related argument
clone_items(items, folder=None, item_extent=None, use_org_basemap=False, copy_data=True, copy_global_ids=False, search_existing_items=True, item_mapping=None, group_mapping=None, owner=None, preserve_item_id=False)
I was wondering if the name or title can be defined in the clone_item funtion, other than end up with
Thank you very much.
Hi @RossMa
You can rename after the clone has taken place
from arcgis import GIS
agol = GIS("home")
## you can get the item_id after the clone,
## either programmatically and add to the clone script
## or manually and use this as a separate scripT
fs = agol.content.get("new_item_id")
properties_dict = {
"title" : "Insert_New_Title"
}
fs.update(item_properties=properties_dict)
I would love this to be an argument in the function. I'm creating occasional backups of items and want the suffix "BACKUP_YYYYMMDD" in the cloned name to clearly delineate backups from the original source data. Having to locate the id of the newly created cloned item is a bit bothersome and just adds unnecessary lines of code.
I would also like this feature. Being able to rename it makes it easier to identify after the fact. Having tons of artifacts with the same name is very time consuming to sift through.