Question: Clone item with desired name/title

413
1
05-17-2022 02:14 PM
RossMa
by
New Contributor II

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(itemsfolder=Noneitem_extent=Noneuse_org_basemap=Falsecopy_data=Truecopy_global_ids=Falsesearch_existing_items=Trueitem_mapping=Nonegroup_mapping=Noneowner=Nonepreserve_item_id=False)

I was wondering if the name or title can be defined in the clone_item funtion, other than end up with 

RossMa_0-1652822026388.png

Thank you very much.

0 Kudos
1 Reply
Clubdebambos
Occasional Contributor III

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)

 

 

~ learn.finaldraftmapping.com
0 Kudos