Modelbuilder - "Get Field Value" and no rows or nodata

Discussion created by sagunn on Aug 9, 2012
Latest reply on Aug 13, 2012 by sagunn
Hi all,

I have built a model that performs a few different intersects on two different polygons.  Depending on the query, sometimes the intersect tool returns a shapefile with no attributes, or no data (e.g. no rows, not even a null row). 

The problem is that my model has to run "Get Field Values" on a column in these shapefiles and, when it encounters these empty shapefiles, "Get Field Values" simply returns 1 and not the "Null Value" that I specify in the tool options.

All of these variables from "get field value" are then passed into a custom Python script that I wrote that writes all the variables to a text file.  I need a way (in Python or before the script is called) to check for empty or no-data variables and reassign the variable before I wrote it to a text file...because "1" is not right!

These are all Double variables.  So, is there a way to check in Python to say "if GetFieldValueX = NoData: GetFieldValueX = 0" or something similar?  What should I be checking for in these variables?

Thanks so much!

System: ArcGIS 10, Python 2.6