Solved! Go to Solution.
Input_Polygons = "Stewardship" with arcpy.da.UpdateCursor(Input_Polygons, ("DateStart", "PlanID", "FFY")) as rows: for row in rows: if not (row[1] or "").strip(): #covers blank, one blank space, or Null Datestarstr1 = row[0] Datestarstr2 = str(Datestarstr1) yearonly = Datestarstr2[0:4] row[2] = yearonly rows.updateRow(row)
Can I use cursors (search, insert and update cursors) in a geoprocessing service that is going to be used in a web app? Thanks
Input_Polygons = "Stewardship" with arcpy.da.UpdateCursor(Input_Polygons, ("DateStart", "PlanID", "FFY")) as rows: for row in rows: if not (row[1] or "").strip(): #covers blank, one blank space, or Null Datestarstr1 = row[0] Datestarstr2 = str(Datestarstr1) yearonly = Datestarstr2[0:4] row[2] = yearonly rows.updateRow(row)