We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!

Alteryx Designer Discussions

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

Browse Folder for input files which should automatically map to its respective input tool!

smogulothu
5 - Atom

Hey everyone, I need help to figure out the following scenario:

I want to browse a folder, which contains a list of files that will serve as inputs in my workflow (say Input1.txt, Input2.xlsx). The contents i.e. the data in each of the file may change but the structure will remain the same in terms of columns and the file name will remain the same as well. When the user selects the desired folder, the files should map to the input tool based on the file name and should run through the workflow and save to an output file eventually. I tried to create a demo workflow(attached below Testing_v3.yxwz) which pops an error(image attached: current_error)

 

Current scenario, I use File Browse tool, but it takes some time to manually select each file that I want to use, for which I'm looking at an alternate solution to do the same. (Image attached: current1)

 

 

3 REPLIES 3
mst3k
11 - Bolide

Use a Directory tool to show all the files in the folder

Make a batch macro to import 1 file and do whatever you want to it (it could output within the batch macro if each input should result in 1 output), or in your main query, just after the batch macro you can work with all the files combined together. 

Your control parameter will be the filepath. Inside the batch macro you can do a dynamic input and switch the path to each incoming filepath fed into the batch macro from the directory tool.

 

echuong1
Alteryx Alumni (Retired)

The issue is because you are replacing the entire input path, with just a folder. There is no longer a specific file name being selected.

 

Adjust the action tool to just replace the folder, and leave the file and sheet name as is if they are going to remain the same.

 

echuong1_1-1617134372150.png

 

simasarry123
7 - Meteor

i have a similar case, but the file names in Input folder are slightly different, they basically have a year as prefix (2018 abc, 2019 abc, 2020 abc etc ) remaining file name remains same. The macros is only reading the file that I have selected as my input and does not read any other file. 

Labels