I have sixteen different feature classes that mostly have the same fields that share the same domain (Pass/Fail). I want to create a script that (1) creates a new FC bringing these all together,
New_Feature_Class field examples: [FirstFailure], [SecondFailure], and [ThirdFailure].
then (2) populates rows with Field Name IF [Field] = Fail.
If a row from one of the original 16 feature classes have no fields with a 'Fail', then none of the new [Failure] fields would get populated.
I've created the first part (below), I just can't even imagine how the second part happens.
from arcpy import *
arcpy.env.overwriteOutput = True
database = "C:\\etc"
arcpy.env.workspace = database
fc_list = arcpy.ListFeatureClasses()
for fc in fc_list:
fieldname = "From_FC_Name"
arcpy.AddField_management(fc, fieldname, "TEXT", field_length = 20)
with arcpy.da.UpdateCursor(fc, fieldname) as cursor:
for row in cursor:
if row == None:
row = str(fc)
final_fc = "path"