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.
Any updates on this?
I was looking into the same topic and couldn't find any way to rename a cloned Feature Service. I'm using API Version 2.4.3.
The only workaround I could come up with is to export the source and republish it under the desired name. But this includes extra steps such as re-applying the symbology, popups etc.
It would be great if we could use clone_items() and specify the target name (for portal & server) directly.