I've created a model in ModelBuilder (ArcGIS Pro 2.7.2) and I'm trying to retrieve an attachment table created previously in the model using feature class to feature class. I'd then like to run the following python script to rename attachments in the table
fields = ['REL_GLOBALID', 'ATT_NAME']
featureClass = 'DFE__ATTACH'
update_dictionary = {}
with arcpy.da.UpdateCursor(featureClass, fields) as updates:
for row in updates:
if row[0] not in update_dictionary.keys():
update_dictionary[row[0]] = 1
else:
update_dictionary[row[0]] += 1
row[1] = 'Photo ' + str(update_dictionary[row[0]]) + '.jpg'
updates.updateRow(row)