Hi All,
How can I get last month monday dates?
Current month is january. I need to pick up only those files which has last month monday date in the filename.
Please help.
Hi All,
How can I get last month monday dates?
Current month is january. I need to pick up only those files which has last month monday date in the filename.
Please help.
Depending on some more details we could do:
e.g.
Directory.GetFiles(YourFolderPath, "*" & now.AddMonths(-1).toString("MM-yyyy") & "*")
I can only see month and year here.
for eg. filename is “Bank Accounts dd MMM YYYY.xlsx” where dd will be last month monday dates.
There will be 4 files (6 dec,13 dec,20 dec,27 dec) in the folder.
Ok, pattern apprioach would work for you
the Monday part I can add. Just give me a little time
Variables:
Flow:
now.AddDays(- now.Day).Day
(From x In Enumerable.Range(0,DayCount)
Let d = now.AddDays(- now.Day + 1).AddMonths(-1).AddDays(x)
Where d.DayOfWeek = 1
Select m=d).toArray
Instead of LINQ you can also implementing it with essential activities (have a look also on repeat number of times for replacing Enumerable.Range)
Find starter help here:
GetLastMonthModays.xaml (4.8 KB)
Thanks , I will try this.
you would need to execute the assign first before you can check it within immediate panel
Is arrLastMonthMondays defined as the correct array datatype?
Have you selected c# as UiPath language? I am writing in VB.
@Poonam_Yadav
Try This :
Now.AddMonths(-1).AddDays(-(Now.AddMonths(-1).Day)+30).DayOfWeek.ToString
Use a counter variable in place of 30.
I am still getting exception
xaml is done on VB
we would recommend to do this, as mentioned above. So set a breakpoint to the comment and remove other breakpoints.
Otherwise just open a new XAML in your project and redo the modeling as described
Maybe you can share with us:
Hi!
Have a view on this workflow its working fantastic.
Regards,
NaNi
Thank you very much Peter.
It’s working fine now.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.