AnsweredAssumed Answered

Field not get calculated in geoprocessing service

Question asked by ionarawilson on Oct 1, 2013
Latest reply on Oct 17, 2013 by ionarawilson
This script works great in ArcMap, updating the field EditField. However when I create a geoprocessing service from the result and run it, the field does not get update, although I get no error messages when running it. Does anybody would have any idea why the field would not get updated with the geoprocessing service? Thank you

# -*- coding: utf-8 -*- # --------------------------------------------------------------------------- # # Created on: 2013-09-30 15:22:46.00000 #   (generated by ArcGIS/ModelBuilder) # Usage: calcfeatures_script <Selecting_Features> <value>  # Description:  # test # ---------------------------------------------------------------------------  # Import arcpy module import os, sys, arcpy, traceback, arcgisscripting  # Script arguments Selecting_Features = arcpy.GetParameterAsText(0) value = arcpy.GetParameterAsText(1) Stewardship = arcpy.GetParameterAsText(2) arcpy.AddMessage("TEST") arcpy.AddMessage(value)   # Local variables: Input_Points = Stewardship #Final_Output = value  Input_Points_Layer = "SamplePoints_Layer"  # Process: Make Feature Layer arcpy.MakeFeatureLayer_management(Input_Points, Input_Points_Layer) # Process: Select Layer By Location arcpy.SelectLayerByLocation_management(Input_Points_Layer, "INTERSECT", Selecting_Features, "", "NEW_SELECTION")  # Process: Calculate Field    with arcpy.da.UpdateCursor(Input_Points_Layer, ("City")) as rows:         # row comes back as a tuple in the order specified here, so Office is row[0], Forester is row[1]         for row in rows:             row[0] = value                         rows.updateRow(row)