AnsweredAssumed Answered

Check for existence of a field

Question asked by noydb on Aug 3, 2011
Latest reply on Feb 26, 2018 by curtvprice
How do you check for the existence of a field in a feature class?  v10.
I did this, but it seems clunky.

import arcpy
fc = r"C:\temp\test.shp"
desc = arcpy.Describe(fc)
flds = desc.fields
fldin = 'no'
for fld in flds:
   if fld.name == 'USNG':
        fldin = 'yes'

print fldin

Outcomes