Using Constant to define input file
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
Solved! Go to Solution.
- Labels:
- Input
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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:
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.
