Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Dynamic Filenames based on Value | Alteryx Gallery

ACharChar
7 - Meteor

Hi! I'm looking for guidance on refining my Alteryx Designer Workflow further. I have developed a workflow that has an Alteryx Application allowing end-users to pull information about a single customer (group) by providing group-specific parameters. In Designer through an import, I can expedite this process by pulling information for multiple groups, resulting in a pdf. report for each group saved out to a local drive. This alleviates the need for an end-user to manually generate a report through Gallery. To generate all these reports simultaneously the import needs to be applied in Designer (not Gallery) and the file path and filename updated given unique date values (these are not current dates and times). 

 

The objective is to accomplish this in Gallery through an import function with an option to set a filename (similar to below) that will append a value; i.e. Group ID. The import functionality is easily understood; the challenge arises with being able to update the file path and filename resulting in the bottom screenshot. 

 

ACharChar_1-1631231541710.png

 

ACharChar_2-1631231653157.png

 

 

 

 

3 REPLIES 3
danilang
19 - Altair
19 - Altair

Hi @ACharChar 

 

You should be able to do this by adding a new Formula tool defining a complete path for the output, placed just before your Render.   

danilang_4-1631363775668.png

 

Add a File Browse interface tool set up in "Save As Dialog", (allows the user to select an output location and file name).  Connect this to the new Formula tool and set up the action tool like this  

danilang_5-1631363809968.png

 

The formula

Replace(Replace([Destination],"directory\",substring(FileGetDir([#1]),findstring(FileGetDir([#1]),":")+2)),"filename",FileGetFileName([#1]))

is to account for the fact that the user will probably have a mapped drive "g:\" and this will have to be converted to a UNC path to work on the gallery and also to replace filename with the user specified filename.

 

Change the configuration of your Render tool to use the entire new OutputPath

danilang_6-1631364120236.png

 

The output part of your workflow will look like this

 

danilang_7-1631364217116.png

 

 

Dan

ACharChar
7 - Meteor

@danilang, I greatly appreciate your contribution. I was able to get the workflow within Designer to run successfully. Within Gallery, the files were generated within "workflow results" but did not write out to the associated drive. Unsure on my end if I swapped out the formula correctly. In your post you indicated you only replaced "directory\" but not the prefix "\\server\share". Can you elaborate on that further? Are we inferring the root is set and does not need to be changed....

 

Maybe it's simple as the Gallery connection does not have access to the underlying directory.....

 

ACharChar_0-1631592564481.png

 

danilang
19 - Altair
19 - Altair

Hi @ACharChar 

 

Does the service account that runs the gallery have access to the output directory?  You may need to check with your Alteryx admin if that's not you.  Log on to the gallery server and see if you can access the path in Windows Explorer.

 

Dan

Labels
Top Solution Authors