Select an upload file from another folder

Hi, I have a problem with my build
so I want to upload an excel file that is already processed beforehand with the robot to our internal system
When I want to upload, there will be a pop up to select a file

the problem is, I want to upload a file that is not in the download folder (the path will be like this D://user/fauzan/document/folder a/folder aa/)

and after that, I want to upload the most recent file in the folder

How can I solve these 2 problems?

Thank you in advance

@Fauzan_Marantama

To Get the path of the latest file from the directory, use below

String.Join(β€œβ€, Directory.GetFiles(FolderPath,β€œ*.py”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1) )

Here *.py will be replaced with your file extension you want

Hope this helps you

Thanks

how about redirecting the open dialog to select a file to go to the specific folder? because in default it will go to the download folder

@Fauzan_Marantama

It’s not required to redirect, Use Type Into activity, Indicate the File name Text box to that, There you can type the entire path of the file and click open

It will works

Hope this helps you

Thanks

from the code
String.Join(β€œβ€, Directory.GetFiles(FolderPath,β€œ*.py”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1) )
folderpath will be removed by my folder path (ex: D:\documents) and *.py will be replaced with the file format right?

@Fauzan_Marantama

Exactly

FolderPath-> The folder you need to search for the latest file
*.py β†’ This will be your file format you want to filter in all type of files

Hope this helps you

Thanks

Okay will try this later, will be marked as solutions if there is no further problem, thank you

Still doesnt work, i already put what you said in the activities like this
image
but the outcome are just the folder location

@Fauzan_Marantama

Can you make entire expression into a message box and check what is file path you are getting

Thanks

After trying it again, it now worked without a problem
Thank you
marked as solution

1 Like

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