We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Select File(s) from a Directory for Processing

TheEmeraldKnight
7 - Meteor

H there,

 

I want be able to select a file or a number files from a given directory and for each selection copy the data to a specific tab in a consolidated Excel macro-enabled workbook.  To help with this the the source files start with B[NNN] so B001 - Daily TB would go the tab B001 in the consolidated workbook.

 

I have gotten as I can with the attached screen shot (the data is sensitive so can't post the workflow) but it shows all files in the directory where I only want ones that start with B[NNN] and keeps asking for the directory.

 

Any help to get this workflow working would be appreciated.

 

Regards,

 

Robert

13 REPLIES 13
caltang
17 - Castor
17 - Castor

You'll need a chained app to do what you want.

 

The first workflow is to call the Directory files and to prepare a temp YXDB that has NAME && VALUE only for your files with condition (starting with... etc.)

 

The second workflow uses that temp YXDB as an input and is called in via the List Box, allowing you to choose the file of your liking.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

The first workflow:

image.png

 

Is to serve as the first or genesis app for end users to find the folder they want. Then you can add conditions to the filter etc like your starts with EE etc., then you can use a summarize tool to generate the NAME && VALUE (rename the columns selected). So NAME basically means what you show as a selection later, and VALUE is basically what is the value underneath the selection. They can be the same or different depending on how you design it. In my example, I used FileName as NAME and FullPath as VALUE, because the filename is easier to read, and the fullpath is what we need later anyway when we use a Batch Macro or Dynamic input to call the data to our workflow.

 

image.png

 

So for me, I know the output here is just for selection in my 2nd workflow (analytic app), so I will save it somewhere temporary. You can find the temp directory here in your User Settings:

 

image.png

 

Before proceeding with the other part, make sure your first workflow serves as a selection and is an analytic app with the interface designer configured as above. Obviously it will lead to Workflow 2, so make sure to save accordingly.

 

image.png

 

Once the setup is complete, head over to Workflow 2, where this serves as your main ETL point after selection:

 

image.png

 

So as you can see below:

 

image.png

 

Your temp file needs to be configured in the List Box tool:

 

image.png

 

Make sure to edit all the parts highlighted in yellow to achieve what you want. So remember the NAME && VALUE thing? It plays here for the selection. 

 

I've attached the workflow and its component assets for you to study. Feel free to ask questions.

 

If the above solved your need, kindly like & mark as accepted solution so that you may help others find the solution more quickly + to close the thread as is. Thanks!

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
abacon
12 - Quasar

@TheEmeraldKnight I will add onto this - IF you are wanting to run this on Alteryx Gallery, you will need to replace the Folder Browse tool with a Text Box and have the user paste the desired location into it because the Folder Browse tool is not supported on the gallery. This means the user would have to paste the fully UNC path (not a mapped drive location) into the Text Box for the Gallery app to find it.

 

If you aren't putting this on Gallery, then this point is irrelevant.

 

Bacon

TheEmeraldKnight
7 - Meteor

Hi Calvin,

 

Thanks you so much for your detailed response 👌

 

For workflow one I have done this...

 

TheEmeraldKnight_0-1750722153922.png

 

...and for workflow two I have done this:

 

TheEmeraldKnight_1-1750722434959.png

 

But I'm getting this message whenever I select a file(s) from the List Box:

TheEmeraldKnight_2-1750722586772.png

The number of files (18) is correct but not sure why Alteryx keeps saying there were no output files?  Also when it's in production can I just open workflow two or do both need to be opened to run the workflow successfully and how do I take the selection and use it to populate my workbook?

Many thanks,

Robert

caltang
17 - Castor
17 - Castor

There’s no output because you didn’t configure an output, you used a browse tool. 

If you want to see results from the browse tool, you need to tick for it in the Interface Designer. 

When you say in production, do you mean on premise or on server? 

If on premise, export Workflow 1, and the assets will include Workflow 2. Because it’s an analytic app, execution of Workflow 1 and after it is finished, Workflow 2 executes. 

If on server, refer here: https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/How-to-publish-a-chained-app-t...

 

Ultimately on server, you need to tunnel in and ensure the workflow 2 path is available on the server and is configured on workflow 1 prior to upload or after upload onto server, and configured in server.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
TheEmeraldKnight
7 - Meteor

I was just trying to see the results as this keeps showing all of the 18 files not just the one(s) I have selected:

 

TheEmeraldKnight_0-1750730807125.png

Sorry - new to Alteryx but how to I configure the Output Data tool to import only those file(s) selected?

 

We are using the desktop version.

 

Regards,

 

Robert

caltang
17 - Castor
17 - Castor

Your filter tool should follow my filter tool. The action tool should follow mine as well. 

Because you are not changing anything via the analytic app execution… you’re basically taking your original formula expression. 

Once you follow my config, you should get it. 

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
TheEmeraldKnight
7 - Meteor

Hi Calvin,

 

Though I'm struggling to get it working it's obviously an issue on my side so I've marked the thread as solved.  Thank you for all the advice.

 

Kind regards,

 

Robert

caltang
17 - Castor
17 - Castor

Upload some dummy data and we can build further.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Labels
Top Solution Authors