lakshmi.mp
(Lakshmi Mp)
September 23, 2022, 6:40am
1
Hi all,
I am able to download the excel file from the website and storing into downloads section.
Once the file downloaded the file name will be InvoiceFrontPage then InvoiceFrontPage (1),
InvoiceFrontPage (2) and goes on.
In one execution only one file gets download.
How to pick the latest downloaded file and rename and then move to particular folder.
Please help me how to do this, thanks.
Regards,
Lakshmi
Gokul001
(Gokul Balaji)
September 23, 2022, 6:45am
2
Hi @lakshmi.mp
How about this expression?
sPathDownload | DataTable → String
sPathDownload = 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
Note → Update extension in the above query
Regards
Gokul
1 Like
RajKumar_DC
(RajKumar Durai)
September 23, 2022, 7:13am
3
Hi @lakshmi.mp ,
try to user “Wait for Download” activity
Thanks,
RajKumar
lakshmi.mp
(Lakshmi Mp)
September 23, 2022, 7:13am
4
Hi @Gokul001 ,
Able to pick the latest file from downloads, how to rename the latest file to Tool dump file and then need to move to desktop folder Tool dump input.
Thanks,
Lakshmi
Gokul001
(Gokul Balaji)
September 23, 2022, 7:17am
5
Hi @lakshmi.mp
Try with Move File activity
Check Out the XAML file
RenameFile.xaml (6.0 KB)
Regards
Gokul
1 Like
lakshmi.mp
(Lakshmi Mp)
September 23, 2022, 7:23am
6
@Gokul001 ,
Can we do this path as dynamic by using (Environment.SpecialFolder.UserProfile)
Thanks,
Lakshmi
Gokul001
(Gokul Balaji)
September 23, 2022, 7:26am
7
Yes @lakshmi.mp , We can
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)+"\Desktop\Tool dump.xlsx"
Regards
Gokul
1 Like
lakshmi.mp
(Lakshmi Mp)
September 23, 2022, 7:40am
8
Hi ,
@Gokul001 , @RajKumar_DC Thank you.
@Gokul001 able to run the latest file and renaming the latest file dynamically. Thank you so much for helping.
Thanks,
Lakshmi
1 Like
system
(system)
Closed
September 26, 2022, 7:40am
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.