AnsweredAssumed Answered

Unable to generate an attachment match table with pictures stored in individual subfolders using python.

Question asked by mtorbettGFC on Jul 11, 2017
Latest reply on Jul 11, 2017 by Alexander_Brown-esristaff



First off, I'm not very good at python but I need help with the follow code. All I'm trying to do is generate an attachment match table by selecting pictures stored in sub folders. Please note that the snippet below is part of a larger script. When I run it, no errors are generated and everything works fine except for the match table (which gets created, but comes up empty every time). I'm using ArcGIS 10.5. and there is a field in the database table named "RadioCall" that has the same names as the pictures. The field is a 'string.'



# Description: Creates an attachment match table for all files by walking through a set of subfolders

rootFolder = "W:\InventoryPhotos"


for folder in os.walk(rootFolder):
   arcpy.GenerateAttachmentMatchTable_management(Fleetdata, folder[0], Matchtable, "RadioCall", ".jpg", "RELATIVE")


Any help would be appreciated.