Are you able to edit a cloned hosted feature service?

64
2
09-06-2019 02:52 PM
Highlighted
Occasional Contributor

Hello,

 

I am trying to create a new version of my bridge inspection data by using the python API. I have cloned the feature service and added a new field and domains using the API. However, I am not able to edit the cloned feature service. To see if my edits were causing the problem, I cloned again and tried edit but still couldn’t. Are you able to edit cloned data in ArcGIS Online?

 

I am receiving the following web map error when editing. “Error Accessing data failed”.

 

Looking at sentences being passed I see the following.

This is what was passed in from my edit:

[{"attributes":{"OBJECTID":107,"brdg_nm":"KELLOG BRIDGE (16)","brdg_no":"1233477","road_nm":null,"road_no":null,"milepost_no":null,"location_id":"T11R38E-2","stream_nm":null,"gis_long_dd":-118.069024618766,"gis_lat_dd":46.4330625042863,"region_cd":100,"strc_serial_no":null,"oper_lvl_cd":null,"design_load_invt":97,"design_load_oper":97,"oper_rate_tons":null,"invt_rate_tons":null,"brdg_open_flg":null,"brdg_posted_flg":null,"severity_rating_cd":null,"fracture_crit_flg":null,"brdg_priv_flg":null,"brdg_cost_share_flg":null,"replacement_yr":null,"superstruct_ty":8,"superstruct_mat_ty":5,"substruct_ty":99,"deck_ty":"1","wear_surface_cd":"1","strc_lng":31,"max_span_lng":null,"curb_curb_wd":26,"out_out_deck_wd":null,"approach_rdway_wd":null,"brdg_yr_built":null,"brdg_note":"GOOD","symbl_rotation":null,"brdg_guid":"3925b5a1-5e1a-4fd1-9ee0-fd0a6723273d","globalid_agol":"3925b5a1-5e1a-4fd1-9ee0-fd0a6723273d","brdg_yr_rebuilt":null}}]

 

Here’s the error:

,"error":{"code":1000,"description":"Invalid object name 'user_349.wadnr_bridge_service_20180324_8468ed444593473da02d3e7cc1250082_STATE_LANDS___BRIDGES__tracking'."}}],"

 

Thank you for your help.

 

Kevin

Reply
0 Kudos
2 Replies
Highlighted
Occasional Contributor II

Hi Kevin,

How are you cloning the hosted feature services?  Are you creating hosted feature layer views?  What is the code you use?  

If using views, you will need to make the view editable as well, assuming the original hosted feature layer is set to be editable as well.  Let me know if you have the code snippet!

Best of luck,

Marisa

Reply
0 Kudos
Highlighted
Occasional Contributor

Hello Marisa,

Thank you for your reply. I have been trying to attach my jupyter notebook but can't find the paper clip. So I have copied the code I am using to clone. Sorry about that.

## clone_bridge 9/3/2019
## Kevin Kozak
## Clones the Bridge collection to new version.
## Input: WADNR Bridges DEMO Version 1
## Output: WADNR Bridges DEMO Version 1 in different folder
##
##


# In[ ]:
import arcgis

# In[ ]:
from arcgis.gis import GIS

# In[ ]:
from arcgis.features import FeatureLayerCollection

# In[ ]:
from arcgis.features import FeatureLayer

# In[ ]:
gis = GIS("https://www.arcgis.com", username = "KEVIN.KOZAK")

# In[ ]:
print("Logged in as " + str(gis.properties.user.username))

# In[ ]:
# bridge demo item
service_item = gis.content.get("c1088872854444a1a472b471ef383f33")

# In[ ]:
service_item

# In[ ]:
service_item.layers

# In[ ]:
itemsArr = [service_item]

# In[ ]:
itemsArr

# In[ ]:
gis.content.clone_items(itemsArr, folder="SurveyWaDNRBridgeInspeBunk", copy_data=True)

Reply
0 Kudos