Alteryx Designer Desktop Discussions

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

Using Constant to define input file

tomgilbert
5 - Atom

I have 5 files saved in a 'Reference' folder, with set file names - say a.xlsx, b.xlsx, c.xlsx, d.xlsx and e.xlsx.

 

I'm after setting a User Constant value where the user can input their folder directory and that value is used when inputting the Excel data.

 

EG setting "C:\Documents\Reference" as the folder, and then using a Formula to create "C:\Documents\Reference\a.xlsx" for the first file.

 

This is to simplify setting the file name in the Input Data tools.

 

There didn't seem the ability to pass a field into the Input section of either an Input Data tool, Dynamic Input tool or a Directory tool.

 

Does anyone have any ideas on how to achieve this?

 

Many thanks.

2 REPLIES 2
CharlieS
17 - Castor
17 - Castor

It sounds like you're looking for the Dynamic Input tool. This is an input tool where the target file path can be updated by the data stream feeding into the tool.

 

https://help.alteryx.com/2018.3/DynamicInput.htm 

 

It's important to note when using this tool that the tool should be initialized/set up, and then the dynamic file it references later should have the exact same field schema (fields names and types). So, if you set it up with "a.xlsx" and the user inputs a new folder to find a new "a.xlsx" then the two "a.x;sx" files should have the exact same fields. If the field schema will differ, this can still be done using a batch macro.

tomgilbert
5 - Atom

Thanks, however the issue is with the 'Input Data Source Template' box requiring an actual file, even if it is subsequently ignored by passing in a new file path.

 

This was one option:

 

https://community.alteryx.com/t5/Alteryx-Server-Discussions/Dynamic-Input-Using-dummy-input-file-for...

 

I created a simple workflow to get round this - creating a text input to save an Excel file in the %temp% folder, to then use this file in the 'Input Data Source Template' box as a 'dummy' file and changing the file path via a formula tool and bringing in the User Constant then.

Labels