This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have created a batch macro where I want to insert a folder of similar files and the macro will apply the same workflow to each. I am testing it with 2 files in the folder. It says that 2 iterations were run but when I open the output file it only shows the output one of the cleansed file. It didn't clean the other. I'm not sure where to go from here. Please help!
Did you check to see if the one file output includes records from both files? It looks like you're batching the import/ETL, but not the Output writing. A batch macro will union all results from each batch to the output anchor. With all records being output at once, the Output tool will only write one file (unless it take the file name from a field with multiple values)
@CharlieS Thanks for your reply! The output doesn't include all the records from both files, just the records from one. I will note that the output file is the output of the input file in the macro workflow. Basically, it says it's reading the other file but its not unioning the other file.
In the batch macro, try appending the file name (from the control parameter) to your output. That way you can confirm that both files are passing through the macro as expected. Then you can use that field to update the output path of the Output tool.
@CharlieS I realized that in the macro workflow I didn't select "Replace a specific string" (as in the path) for the action for the input file. However, I came across another issue when I did select that. I believe that it was running the two files but when it got to the second one my dynamic rename tool did not work. I'm not sure why because the two files have the same formatting.
The Dynamic Input tool is verrrry picky about fields matching (even string length changing). I suggest adjusting your batch macro so that the control parameter uses an Action to directly update an Input tool. The Input tool will be far more tolerable in a batch input scenario.
@CharlieS I am using a control parameter to update the input tool. Not sure why it's not working. If I run both files individually in the macro workflow it runs fine. However, when I run it through the batch macro workflow that's when I get an error in the dynamic rename tool.
The screenshot showed you're using the Directory Input tool (perfect), and that's connected to the Control Parameter "?" input. All that should be left is to select the "FullPath" field on the macro to set the Control Parameter field. That's done and still doesn't work?
EDIT: Since these are Excel files, how are you handling the sheet names on the input? Different sheet names will break this process too.