Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Render data in different folder dynamically

SH_94
11 - Bolide

Hi community, I trying to explore if we can generate the output dynamically without creating folder manually. I have data list whereby it contain week data and i have to create folder every first week manually folder and change the file directory for each output. May i know if we can adjust it in the alteryx without creating the folder manually , sometime i need to create folder monthly meaning 0625, 0725 and etc, and some data i need to save it weekly - 04082025, 11082025. Thank you.

5 REPLIES 5
KGT
13 - Pulsar

The only way that I know how to do this is to use a Run Command tool to make the directory using a BAT file. You could definitely make this a lot better with a designated BAT format, but this is just a quick off the top of my head.

  • Get output location as a field
  • FileGetDir([Field])
  • Construct a BAT with the command md [Field]
  • Use Run Command writing out that file and then executing producing a result, or using a dummy file to read back in.
  • Append the output to your stream (going around the Run Command) and then drop that field straight after followed by a BUD ---- this is just making sure that the Run Command completes and then the workflow can continue.
  • Write using Output Tool and option to take filename from field (Change Entire FilePath).

 

 

FileExists(Path) may also help in order to check if the directory is already there somehow.

Gaurav_Dhama_
12 - Quasar

You can build a folder using render tool.

How this will work is,

  1. Create an output file with same name as your newFolderName \ original output name.
  2. If folder does not exist, it will create the folder and also the file.
  3. Now you will output your data to the file and replace your render output/use that, that depends on you. We just wanted to create the file to create folder.

 

SH_94
11 - Bolide

Hi @KGT ,

 

Thank you for the response and would like to ask if you have example worklfow for this? Would like to see how it work.

 

Thank you so much for the support.

alexnajm
18 - Pollux
18 - Pollux

@SH_94 a quick Google search will yield some workflows for you to try, like this one: https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Help-Using-Run-Command-tool-to...


Please try the suggestions from @KGT and @Gaurav_Dhama_ , and come to us with any errors along the way!

KGT
13 - Pulsar

I don't have one handy. The suggestion by @Gaurav_Dhama_ is a good workaround as well.

 

As Alex mentioned, a search will yield several. There are several examples around on the community as well, such as this one: https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/My-run-command-batch-file-is-c...

 

 

 

Labels
Top Solution Authors