Hi guys,
I am trying to make a new filter with makeFeatureLayer_management . it works fine in arcgis pro as standalone script but while running as a geoprocessing service it shows me an error :
the code snippet :
arcpy.MakeFeatureLayer_management(CADSrs, CADlyr,"\"Layer\" = 'karar'")
My question is there any different way to make this filter with python "\"Layer\" = 'karar'"?
I've tried to add r before But it didn't works for me.
Thanks In advance
building the whereclause depends on the source of the data.
Try using AddFieldDelimiters
fc = r"C:\a_path\to\a\file_geodatabase.gdb\featureclass_name"
whereclause = """{} = 'bob'""".format(arcpy.AddFieldDelimiters(fc, 'Name_2'))
whereclause
"Name_2 = 'bob'"
the structure depends on the source