Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Folder Browse to Change Output Path

jcastles003
6 - Meteoroid

I have a workflow that outputs several different Excel files. Since most users will be using this as an app, but not in the gallery, I need a way to customize file/folder locations for output.

 

The File Browse tool works perfectly for output.  However, since I have multiple files being output in this app, I would like the ability to have the user select one folder output location, and all of the output tools would then output their corresponding files to that folder location, rather than having to specify each individual output file.

 

I have tried multiple different methods with the Folder Browse tool, but cannot get it to work correctly.  I have tried Update Value, Update Value (with Replace a Specific String selected for the folder path), and Update Value with Formula, and none of them seem to change the folder path from the default one pre-input in the workflow.  Does anyone have any insight as to how I can get this to work correctly?

12 REPLIES 12
patrick_digan
17 - Castor
17 - Castor

@jcastles003 I've attached a simple example which hopefully helps. Pay particular attention to the way the action tool is setup. As an alternate (and my personally preferred method), you can use the %Question.ToolName% method. I've included both in the attached. Let me know if that doesn't help!

jcastles003
6 - Meteoroid

Thanks for providing your example.  When I test yours out, it works exactly as I want, but I still can't get my own to work.  It's as if it just completely disregards my folder browse input and still tries to input into the same location provided in the output.

 

Is there something I am doing wrong?  Does it not work if you're overwriting a tab within an Excel document?  Every time I run the below workflow, it still writes it to the original save location, C:\Data\, not where I have selected on the Folder Browse.  Note that it still causes an error even when I have C:\Data\ created, so it's not that it's unable to find the directory.

 

Here is what I have:

 

Output Data Tool:

Output.jpg

 

 

Folder Browse:

Folder Browse.jpg

 

Action Tool:

Action.jpg

 

jcastles003
6 - Meteoroid

I got your other method to work, where I have a Folder Browse disconnected from the output, and then put in "%Question.Folder%\" as the destination folder in the output.  However, this method ruins my ability to run the workflow as a workflow, not as an app, which I would still like to retain the ability to do.  Thus, my goal method would be to do your first example.

patrick_digan
17 - Castor
17 - Castor

@jcastles003 2 quick replies : 1) you will need to change your action tool by clicking on the file-value row. It's not at all obvious, but the row you select in the action tool is the only row that anything can be changed on. 2) the %Question.Folder% method just moves the default location to your workflow configuration window:

Capture.PNG

Whatever data you put in here will be passed when you run it as a workflow (and will be completely ignored when run as an app).

 

Hope that helps!

jcastles003
6 - Meteoroid

Thank you so much!  I would never have figured that out.

Apratim
5 - Atom

Hi Patrick,

 

Sorry I couldn't understand your solution. I have the same query as @jcastles003.

Made changes as per the specimen workflow "Output to Folder" uploaded by you, but couldn't make it work.

jcastles003
6 - Meteoroid

Where are you getting the error?  For me, after I copied in @patrick_digan's initial solution, the problem for me was that I didn't click on the right row on the action tool variable or attribute to update (have to click on the file path row in the action tool).  If you upload a sample of your workflow, I might be able to help.

Apratim
5 - Atom

Hi, I have attached a sample workflow. I am able to use the selected output folder for the output file which is directly connected to the action tool.

However, the same doesn't happen for the other output file. Please find below a snapshot of the action tool configuration:

Capture1.PNG

jcastles003
6 - Meteoroid

The key to using the %Question.ToolName% method is that the "ToolName" portion of it has to be exactly the same as name of the specific Folder Browse tool.  I have updated your workflow so it works and attached it.

 

Previously, the name of your "Select output folder" Folder Browse tool was:What the Folder Browse tool is named in your original fileWhat the Folder Browse tool is named in your original file

 

You input the "Write to File or Database" destination on the Output Data field using the %Question.ToolName% method, which is:What the "Write to File or Database" destination is on the second Output Data tool in your original fileWhat the "Write to File or Database" destination is on the second Output Data tool in your original file

 

Thus, since the ToolName portion of that has to match the Browse Folder tool name exactly, if I change the Browse Folder tool name where indicated below, the workflow works as intended, outputting both files to the same location.

I changed the tool name of the "Browse Folder" to match the "Write to File or Database" destination you input in your original fileI changed the tool name of the "Browse Folder" to match the "Write to File or Database" destination you input in your original file

 

Alternatively, you could connect a second action tool to the Browse Folder tool, coming from the second Output Data tool.

Labels