I'm charged with maintaining QA logs embedded in a feature on ArcGIS Online.
Basically I just have to change some fields in the feature.
The problem is that I wrote scripts using cursors to update the feature, but whenever I run the script, though it says it worked fine (no errors reported from the script and the temporary copy successfully reflects the edits I want) the edits all disappear whenever I sync my edits to the service.
I've been talking with ESRI tech support, but still can't figure it out.
I thought I'd post the question here to see if anyone else is working with ArcGIS Online.
Note: of the fields I am changing one has geodatabse level domains enforced. I copied those domains to my working feature which I store all of my edits in, so I wouldn't think that would be a problem.
Also, I can successfully do this manually, however I have too little time to do it that way, and I need a solution moving forward.
Here's the code, but I've already verified that the code works on local copies of the data:
import arcpy from arcpy import env from arcpy.sa import * # Set environment settings=============== arcpy.env.workspace = "C:/workspace_filepath" featureClassToUpdate = r'path_to_AGOL_feature_class_in_temp_geodatabase' joinFile = r'file_with_formatted_edits' #==================================== #create an array of values from the crossing scores csv file: updateData =  #create an empty array that will be populated shortly: fields1 = ['SADES_ID', 'REVIEW_LEV', 'DES_REVIEW'] with arcpy.da.SearchCursor(joinFile, field_names = fields1) as toSearchCursor: #with arcpy.da.SearchCursor(joinFile, ['SADES_ID', 'REVIEW_LEVEL', 'DES_REVIEW', 'QA_Comments']) as toSearchCursor: #^Edit formats here; QA_Tracking_Format for row in toSearchCursor: templist =[row, row, row] updateData.append(templist) #^put the table to join into an array in temp memory (this shouldn't be too big for python to handle, but I wouldn't throw the whole database at it... (actually it handles the whole database just fine.) #==================================== #with arcpy.da.UpdateCursor(featureClassToUpdate,['SADES_ID', 'REVIEW_LEVEL', 'DES_REVIEW', 'UPDATE_COMMENTS']) as toUpdateCursor: #^Currently no fields are large enough to handle our update comments. fields2 = ['SADES_ID', 'REVIEW_LEV', 'DES_REVIEW'] with arcpy.da.UpdateCursor(featureClassToUpdate,fields2) as toUpdateCursor: #^Edit field formats here: SADES2; Also, if QA comments ever becomes implemented then it can be added here. #open up an update cursor on this file, and activate only fields in brackets^ - like a python array for row in toUpdateCursor: for x in updateData: if row == x and row is not None and row != 0:# and x>250: #if both rows have the same SADES_ID (which is in teh 0 position), and SADES_ID isn't <Null> or 0: row = x #update row with ReviewLevel row = x #update row with DES_REVIEW #row = x # Update_COMMENTS print row print "... updating... " #inform user for debugging... toUpdateCursor.updateRow(row) #actually enforces the updates that are entered above print "Scores copied from table. Routine Complete."