How to get the date(dd) of every monday

Hi @MartianxSpace I want to get the day(of monday) of the current week

e.g this week monday day is 10.

If I run the code in next week then it need to return as 17. Could you pls provide any suggestion on this?

@Martia nxSpace, @Ragu9060, @Boopathi
@Ula_Solution.xaml (10.7 KB)

THIS IS VERY EASY!!!

THIS WORKFLOW SHALL RUN FOR ANY YEAR THAT YOU WANT TO ENTER

Please find the below workflow where I have added a simple self explanatory workflow!!

Please mark this as SOlution if you found it usefull.!!

Thanks and Regards,
hacky

1 Like

@hacky Awesome :grinning:!

1 Like

hi @hacky @MartianxSpace Thank you. Actually I am checking if a file exists in the folder or not but the file name is saved as month/mondayday format - 0210.csv.

This week file is saved as 0210 and I need to check whether this week file exists if I found 0210 in the filename. If file not found, i need to throw exception as current week file not found. Could you please help me on this?

Thanks.

@Boopathi I would suggest

  1. Get the Filename and remove .csv using Regex or Split
  2. Compare date with the solution provided by @hacky

Let me create a process

Hi @MartianxSpace Thank you. I completed the step1. Getting file name using regex. Trying to check if the file name contains current week month mondayday

@Boopathi So your file name contains Monday’s Date only?

@Boopathi Check this Expression, I guess this will give you the Monday Date of the current week always:
now.AddDays(now.DayOfWeek * -1).AddDays(1).Day
and I guess you know how to get current month : now.Month :sweat_smile:

Hi @supermanPunch will it work even if i check on Friday also?

First week of the day is Sunday - just for your information.

@Boopathi Yes First Week of the Day is Sunday, hence I’m Adding 1 day , So I tried out the Expression with date as 01 Feb , it gave me the Output as 27 Jan as 27 is Monday , So if this is the Output you require , i guess this will work whichever Day you execute it

1 Like

@Boopathi

use this

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