Hi Community,
I need to select my input folder dynamically like,
If the workflow runs on 1st Jan, directory path should be as "Z:\Claims\2024\December"
Similarly, If the workflow runs on 1st Feb, directory path should be as "Z:\Claims\2025\January" and so on.
Can someone please help ?
Solved! Go to Solution.
Ahoy,
To do this you need to create a Batch Macro,
This macro has a Directory tool in it which has the folder path being updated by using a Control Parameter Tool and an Action Tool
This macro can then be used in a workflow where you calculate the folder path you wish to pull from, and feed that into the macro.
See the attached workflow, hopefully that solves what you need. The macro can be improved upon so that you have the option to fully update the configuration of the Directory tool in the workflow if you wish.
Hi @Carlithian
I had created a similar macro where I had selected Update Value (Default) once and Update Value with Formula for the second time, but still the Directory-Value was not getting replaced.
"O:\Alteryx\MTB\" +tostring(DateTimeFormat(DateTimeAdd(DateTimeToday(), -1, "months"), "%Y")) + "\" + tostring(DateTimeFormat(DateTimeAdd(DateTimeToday(), -1, "months"), "%B"))
Please let me know if something's wrong with my formula here or how can I execute this.