We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Dynamic Directory folder Selection

akvsachin
8 - Asteroid

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 ?

2 REPLIES 2
Carlithian
11 - Bolide
11 - Bolide

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

 

Dynamic Directory.jpg

 

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.


Happy Alteryxing
akvsachin
8 - Asteroid

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.

Labels
Top Solution Authors