Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Dynamic File and Sheet Selection

Will-G
7 - Meteor

Hi,

 

I was wondering if anyone could help with dynamic file and sheet selection?

 

I've been asked to create a workflow that reads the most recently created excel file in a folder and the most recently created sheet in that file. The file names are identical except for an ordering number at the start and the date of the file (e.g. Mar 2021) at the end.

 

I've tried doing this with the directory tool, some sorting and the dynamic input tool (see attachment). Unfortunately I can't quite figure this out and I'm getting an error on the dynamic input tool saying 'Unable to open file for read'.

 

I'm new to using Alteryx, so any help or suggestions would be great. Thanks! 

7 REPLIES 7
bensilv
Alteryx
Alteryx

Hi @Will-G, could you send a screenshot of the configuration for the dynamic input tool?

 

Judging by the error message, it looks like the tool might be pointing towards a folder instead of a file.

Will-G
7 - Meteor

Thanks bensilv. I think you're right that it's pointing towards a folder (see screenshot below).

 

Is it possible for the dynamic input tool to read the newest file from this folder? This is essentially what I've been tasked with doing (along with the latest sheet).

 

WillG_0-1631093513614.png

 

bensilv
Alteryx
Alteryx

Yes absolutely. 

 

What the dynamic input tool needs is a template to match to and populate. In the configuration you have, you have not selected a valid input data source template - this should be a matching template to the file you're bringing in.

 

Please see here - https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Input-Latest-File-from-a-folder/m-p/84...

Will-G
7 - Meteor

Thanks again, I think I understand the dynamic input tool more now. I'm now getting a 'no sheet specified' error, which I did have previously.

 

The workflow I've created looks like the following, but I also need to figure out how to dynamically choose the newest sheet. Could you recommend a way to do this if possible?

 

WillG_0-1631095035116.png

 

bensilv
Alteryx
Alteryx

Is the sheet specified in the formula tool? So the field FullPath, does that have a sheet name at the end?

 

And is the sheet specified in the template?

Will-G
7 - Meteor

I created a new field that has the full file path with '|||' and the sheet name added.

 

WillG_0-1631095869324.png

 

And I think this matches the sheet specified in the template. I selected the 'Mar 21' sheet, which was the sheet name added.

bensilv
Alteryx
Alteryx

That format looks to be correct. When you added the template, did it run your through a wizard to select a sheet?

 

i.e. is the table or query populated here?

 

bensilv_0-1631105474878.png

 

Labels