Need to select an image file (file name should be dynamic) and then upload to web

Need help please, since the flow is failing somewhere. I need the bot to capture a picture from the webcam → that image gets saved to a shared folder → bot needs to grab the latest dynamically saved filed (current date and time stamp) → then needs to upload it to an amazon site.
My before and after flow works but this saving the file with a new filename everytime is failing and also I’m unable to open that folder and grab that file. Not sure what steps are being missed.

That is the folder path, the picture files get saved. But I want to have them named dynamically as the top file - everytime. Then those files need to be selected and then uploaded.

This post shows how to grab the latest item in the folder, so you wouldn’t have to mess with the filename at all. Would this work for what you need?

Thanks for sending this information. I reviewed it briefly but the filename needs to be unique plus have the time and date stamp. Also eventually those files will be saved in the DB for reference purposes. The problem I’m having is also that the bot doesn’t go to that folder automatically and select the file. Having a bit of hard time.
I tried to use the Assign functionality but not having luck.

To rename a file you can use the Move File activity. You just “move” it from the old name to the new one. The FileInfo class can tell you when a file was created or modified, and then you can use that in the move activity to rename the file to the date and time it was created or modified.

Ok thank you. Let me read that information.
Still how to have the bot go that specific folder which resides on my local machine - is still a challenge too :frowning:

hardcode the path to that folde in a Config file??

So I found this after reading the conversations :

PDF_Word_Fetch.xaml (9.9 KB) String.Join(“”,Directory.GetFiles(“FolderPath”,“FileType/FIleNameSequence”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1) )

where
FileType is the type of file you are looking for

Would that work in my case if I have a folder on my local but all the files are image files in .jpeg format ?
So how does the code change?
I want to grab the latest file and then move it to another folder that I would create in that directoy. I can use the delete file or move file, right ?

This is my sample .XAML…will that work ?