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

Passing User Prompted Variables to Output Path

robertfishel
8 - Asteroid

Hello everyone.  I am trying to figure out where in my workflow I need to place tools that will allow me to pass user prompted variables to my output path.

 

For example, the final output path needs to be BOOK_ABC_1234_CASH_062718, with the variables being 1234 and the date at the end, 062718.

 

I tried to use a Text Input Tool/Action Tool/Output Tool combination, but this is not working.  When the user runs the workflow, I would like for them to be prompted for the values that need to go in the 1234 section, and the date section at the end.

 

Capture3.PNG

8 REPLIES 8
patrick_digan
17 - Castor
17 - Castor

@robertfishel I think this post from yesterday is a similar question and I provided a couple good solutions. Try looking through that and seeing if you can apply it to your situation. If you want the user to be prompted, that is done through interface tools in alteryx. For the 1234 you would need a text box interface tool. For the date at the end, you could use a text box tool or a date tool.

 

Once you have your two interface tools added to your canvas, there are a few different methods to "pass" that data to your output tool. The standard method is using action tools. So you would connect the interface tool to the action tool to the output tool. I assume you can use the community and the help docs if you need to learn the basics of using action tools.

 

I prefer a different method called reference shortcuts where you don't need action tools. I find it easier to test and debug. I demonstrated both the action tool and reference shortcuts in the post i mentioned.

 

Post back here if you get stuck along the way!

DavidP
17 - Castor
17 - Castor

I think this will do what you want.

 

user defined output file path.png

robertfishel
8 - Asteroid

patrick_digan, DavidP

 

I am not getting this, after spending most of yesterday 

sad homer2.PNG

 

I am a visual person, so I wrote out on paper what I "think" it is that I am supposed to be doing.  Am I missing a step?

 

Sketch.PNG

 

 

DavidP
17 - Castor
17 - Castor

Have a look at the attached app and explanation below:

 

As you're looking to update 2 values in your filename, I used 2 text box inputs. You then tell it in the action tools which part of the string from the text input tool you want to update with the value from the text box.

 

I then added a formula tool to add a folder (the current one where the app is saved) and the output file type.

 

Now you have a full path string that can be passed to an out put tool, so you add it as a field to your dataset and then in the config of the output tool (which you set up the write to a dummy file name and location), you use the option "Take filename from field" and "Change entire file path". I also unchecked "Keep field in Output" so that the path name is not written to the file with your dataset.

 

You could of course pick the output file type of your choice. Just remember, if you pick an Excel file, you have to specify the Sheet Name in the file path as well, such as BOOK_ABC_1234_CASH_06271.xlsx|||Sheet1

 

user defined output path.pnguser defined output path 2.pnguser defined output path 3.png

mbarone
16 - Nebula
16 - Nebula

Hi Robert,


Unless I'm misunderstanding something, wouldn't the attached work?  Basically you just want to update a couple strings the final output path, with user-entered strings; no?

mbarone
16 - Nebula
16 - Nebula

Opps - wait - forgot to adjust my Action tool.  The YXWZ I attached will be fine, but go into the Action tool.  Right now, the "@MaxRecords" is the field that I had selected.  You'll want to change that to the "File" field.  Meaning just click on the the first highlighted line in my picture below.

 

 

JPG1.jpg

 

robertfishel
8 - Asteroid

mbarone, you were correct.  Your solution helped me figure out what I needed.  DavidP, patrick_digan, as always, thank you for your help.  I hope that this thread will help others find possible solutions to the same problem.  Here is what my final workflow looks like.....

 

workflow.png

 

mbarone
16 - Nebula
16 - Nebula

Awesome, glad to hear it!

Labels