I am trying to assign the full file path of a specific file to a variable filepath.
It is a dynamic latest file which I download from a website on a daily basis. The reason why I am going to extract the full file path of the file is because I have to upload the attachment on a daily basis as well in another online form.
I’ve done these but it couldn’t work as I expected:(,
assign latestattachment=Directory.GetFiles(FolderPath,“.pdf”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Take(1)
This is how I have to upload the attachment and I am trying to extract the full file path and use 'type into’activity in this.
May I ask how to fix the issue or is there other way to make it happen?
Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)+"\Downloads").[Select](Function(x) New FileInfo(x)).Where(Function(f) f.Extension.Equals(".xlsx")).OrderByDescending(Function(x) x.LastWriteTime).Take(1).ToArray()(0).ToString