I have a shapefile of drone flight footprints that I am trying to merge an excel tracker/log file to. The shapefile and Excel file will change each time I run the script so I am trying to store the names of both in two separate variables.
First I bring in the shapefile. Then I bring in the .xslx Excel file. Next I convert the Excel file to a table (.gdb), then I attempt to join based on a common field.
However I get the following error and a failed join:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files (x86)\ArcGIS\Desktop10.8\ArcPy\arcpy\management.py", line 6587, in JoinField
raise e
RuntimeError: Object: Error in executing tool
Here is my code:
#STEP 1 SETUP DIRS
root = r"C:\users\[USERNAME]\Desktop\ORTHO_FOOTPRINT_AUTOMATION" #change the filepath here
inputs = root + r"\INPUT_CSVS" #input directory of geotag CSVs
steps = root + r"\STEPS" #location of temporary file storage of intermediate processing steps
rfoots = root + r"\STEPS\rasterfootprints" #subfolder in steps to store the 100's of rasterized individual photo footprints
outputs = root + r"\OUTPUT_SHAPEFILES" #location of final
### STEP 23: MERGE INDIVIDUAL SHAPEFILES INTO MULTIPART SINGLE SHAPEFILE
arcpy.env.workspace = outputs
arcpy.env.overwriteOutput = True
shplist = arcpy.ListFiles("*_footprint.shp")
arcpy.Merge_management(shplist,"ImAc_"+ CampaignNum +"_Usable_Footprints_Merged.shp")
# STEP 24: JOIN TRACKER TO MERGED SHAPEFILE
arcpy.env.workspace = outputs
arcpy.env.overwriteOutput = True
in_file = arcpy.ListFiles("*_Merged.shp")
in_table = arcpy.ExcelToTable_conversion(Tracker,"Tracker.gdb")
arcpy.JoinField_management(in_file,"FLIGHTNAME",in_table,"Flight_Pla")
And here are the files in question. https://drive.google.com/drive/folders/1ue1fWwAd90EhaBRtxPPoaUXCj4gtsBmv?usp=sharing
What am I doing wrong?