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.
SOLVED

Dynamic Input read

suby
11 - Bolide

Hello All,

 

 How to create a workflow that reads the latest file from the shared directory.

 

- Scenario

 

I have two files coming into my shared directory daily but I want to pick one of the files and want to make this dynamic going forward. In the below example

 

XYZ.xlsx -  04:05:28

ABC.xlsx -  04:05:20

 

16 REPLIES 16
suby
11 - Bolide

Thanks for the explanation.

 

In my example these are the two files which are copied daily in my shared drive. - I'm interested in XYZ file only.

 

ABC_2020-07-22T080641362Z -  2020-07-22 15:09:05
XYZ_2020-07-22T080641362Z -  2020-07-22 15:07:56

 

As per your instructions by changing the sort tool to 'ascending'   I get the output from the sample tool is

'XYZ_2020-07-22T080641362Z -  2020-07-22 15:07:56'  which is fine because on the sort tool we do by 'creation Time' and by 'Ascending'

 

what happens if there is a scenario when ABC file is written In my shared directory before the XYZ file in that case how we can we read XYZ file?

 

Attached the doc for your reference.

JosephSerpis
17 - Castor
17 - Castor

Hi @suby if you want the XYZ file only then use a Filter tool with a contains XYZ_ then it search for a file with that in the file name.

suby
11 - Bolide

Thanks so you mean to say that at anytime it will look for that file name in the filter tool and then sort the creation time by descending and then filter the row based on the sample tool?

 

sorry to ask you this do I still need this columns. ? if so why we are the formula tool to create this.

 

SheetNames
"<List of Sheet Names>"

FileName
Left([FileName], FindString([FileName], "|||"))

Fullpath
[FileName]+"|"+ [Sheet Names]

JosephSerpis
17 - Castor
17 - Castor

Hi @suby if you use the filter tool then you can remove the sort and sample tool. Yes that correct using a Filter tool will mean it always search for that specfic file. The formula tool and Batch macro is a dynamic solution to find the sheet names of an excel you want to pull into alteryx. You can remove them if you know the sheet name won't change. The dynamic Input tool to work correctly needs the filepath, file name and sheet name e.g. C:\InputFolder\Inputfile.xlsx|Sheet1. Hence those parts of the workflow automate that process. 

suby
11 - Bolide

Hello

 

Thank you so much for your time and I really appreciate that.

 

Just one final question you said 'if you use the filter tool then you can remove the sort and sample tool'  but if I remove the sort and sample tool how does it picks the latest file by creation Time? since the file names are like. XYZ_Datestamp.xlsx and say I might get a file tomorrow with something like XYZ_2020-07-23T080641362Z.xlsx in that case I need this file to be picked up as you said the sheet names inside this file name will remain the same all the time.

 

XYZ_2020-07-22T080641362Z.xlsx

 

 

JosephSerpis
17 - Castor
17 - Castor

Hi @suby in that case have a filter tool in between the sort tool and sample tool that searches for your specific file so that the sample tool it picks the latest version of that file.

suby
11 - Bolide

Thank you so much for your time.

Labels