AnsweredAssumed Answered

Geoprocessing Service Input Never Changes

Question asked by crookcountygis on Jul 1, 2016
Latest reply on Jul 6, 2016 by crookcountygis

Hello all,

I have a simple geoprocessing service (for now) that I want to look at a feature class on my SDE, look at a specific row, count all the NULL values, then email me that number. I have it working like a champ in ArcMap and I even have the email working great when it's a service. The issue I'm running into is when I change the number of values that are NULL, the geoprocessing service seems to be looking at a copy of what was there when I first published it. So if I had 20 values that were NULL when I published it then went back and tweaked the data to be 10 values, when I run the service it will still email me that 20 are NULL values.


I can't figure out if I'm referencing the data wrong in my geoprocessing script, or if there is something else I'm missing.


# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# Created on: 2016-07-01 08:54:14.00000
#   (generated by ArcGIS/ModelBuilder)
# Description: 
# ---------------------------------------------------------------------------

# Import arcpy module
import arcpy
import smtplib

# Local variables:
CROOKADMIN2_DBO_cornersTest = "Database Connections\\CROOKADMIN2.sde\\CROOKADMIN2.DBO.grids\\CROOKADMIN2.DBO.cornersTest"
DBO_cornersTest_Layer = "DBO.cornersTest_Layer"

# Process: Make Feature Layer
arcpy.MakeFeatureLayer_management(CROOKADMIN2_DBO_cornersTest, DBO_cornersTest_Layer, "hyperlink IS NULL", "", "OBJECTID OBJECTID VISIBLE NONE;alpha alpha VISIBLE NONE;hyperlink hyperlink VISIBLE NONE;GlobalID GlobalID VISIBLE NONE;township township VISIBLE NONE;range range VISIBLE NONE;numeric numeric VISIBLE NONE;lastedited_who lastedited_who VISIBLE NONE;lastedited_date lastedited_date VISIBLE NONE;Shape Shape VISIBLE NONE")

rows = arcpy.SearchCursor(DBO_cornersTest_Layer, fields="hyperlink")

numCorners = 0

# Iterate through the rows in the cursor and count the number of new records
for row in rows:
  numCorners = numCorners + 1

#A bit more stuff that doesn't matter


There's more that has to do with the emailing but doesn't matter.