I'm running an unchanged workflow that has run for 3 months successfully to read in multiple Excel files from a directory. The workflow had been modified from the solution to this post Read multiple Excel files with different sheet names.
Each of the files contains 2 tabs. The Dynamic Input tool is configured to look at the 2nd tab in the first file in the folder, but with this month's files it is reading in the fields from the first tab.
I don't understand the Dynamic Input tool enough to understand what is going wrong. The files are in the exact same format as the previous month's. I am running two separate workflows, one formatted for last month's files and another for this month's files, but this month's files are failing.
Below is the comparison of the fields returned by the 2nd Dynamic Input Tool for both workflows. There should be 23 fields names returned.
Working results returning the 23 field names from the 2nd tab:
Failing results returning 7 field names from the 1st tab:
Solved! Go to Solution.
Hi @sonseeahray
Check the most recent file. It could be that the sheet order has been changed within the excel File. That would cause the workflow to read from the incorrect tab.
Your workflow doesn't appear to have anything that sorts the sheet names alphabetically, so the dynamic workflow will read from the first sheet in the list. In the attached workflow, I read the list of sheet names from 2 excel files with the same data on the same sheet names. The difference between the the 2 excl files that one of them has the sheet names reversed.
Passing these lists of sheet name to a dynamic input will cause it to read the list of columns from sheet 1 in the original file and sheet 2 in the reversed order.
Dan
Thank you @danilang, I wondered how that worked because I didn't see anything in the Dynamic Input tool that would cause it to read in a sheet other than the one I had configured in it. I'll give it a try.
@danilang it downloaded...had to restart my computer
Hi @danilang, the sheet order is the same though...
Here is last month's list of sheet names that the Dynamic Input tool is reading the 2nd sheet:
Here is this month's list of sheet names where it is reading the 1st sheet:
Got it to work by filtering out the sheets with "2722" prefix, since this is a constant in the sheet name. I still don't understand what caused the Dynamic Input tool to read the first sheet rather than the 2nd in the current month's files, especially since I had designated which sheet to read in.