Check whether file downloaded or not, based on near time

Hi all,
I am downloading data for certain dates from webpage in excel format, and have to process it further for formatting. Sometimes it’s available for chosen dates, sometimes its not and simply log out. How to make sure if the latest file of near time is downloaded or not.

There might be other files with similar name, just index difference, say file,file(1),file(2)… in the folder
How to proceed with this, using path exist?
For the shown image path exist returns true everytime as it’s fetching last 1 latest file from folder…
Thankyou
Neha

Hi @Neha_Kumari1
what is the issue u are facing here ?

Hi @NIVED_NAMBIAR
Thankyou for responding.

I am trying to fetch file on basis of latest time, if it’s downloaded then the workflow would further proceed with formatting, if there won’t be file with latest time, execution should stop there only.
I am not sure on how to assemble this assign and path exist together for the same.

Hi @Neha_Kumari1
well , there is no need of path exists as u are filtering via assign activity.

May i know within what day time file should be within the folder, is it daily basis or not

Okayy
Yes, file is downloaded on daily basis, say, for today’s day, file would be downloaded as file09-06-21
And if process runs multiple times a day, it would be as file09-06-21 (1), file09-06-21 (3) so on

Hi @Neha_Kumari1
then u can use this assign activity to filter your files

Directory.GetFiles(folderpath).Where(Function(file) Path.GetFileName(file).Contains(Now.ToString(“dd-MM-yy”)))

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.