cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
giangnguyen
Level: Powered On

Duedate but will not be counted on Saturday and Sunday

Dear All,

When submitting the form, the process will planner create a task with a duedate of 3 days, but if it is Friday, it will not be charged on Saturday and Sunday, but will be charged on Friday, Monday and Tuesday. Thanks you.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Duedate but will not be counted on Saturday and Sunday

Hi @giangnguyen ,

 

Do you mean Submission Time as Start Date, then add three days as Due Date and exclude weekends day?

You could refer to the following method to configure Flow.

  • Initialize three variables, Date is used to indicate the date that may be included in the task, Number is used to control the loop, and the last variable is used to record valid Dates.
  • Use dayOfWeek() function to exclude Saturday and Sunday and append the valid date to the array.
  • Each loop requires a day plus of Date.

Expression reference:

 

formatDateTime(body('Get_response_details')?['submitDate'],'yyyy-MM-dd')
dayOfWeek(variables('Date'))
addDays(outputs('CurrentDate'),1,'yyyy-MM-dd')

Image reference:

 

4.PNG

Details of Apply to each:

5.PNG

Details of Do Until:

7.PNG

Details of Condition:

8.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Duedate but will not be counted on Saturday and Sunday

Try the following formula.  Replace Datepicker with the field for your duedate.

If(Weekday(DateAdd(DatePicker1.SelectedDate,3,Days))<2,
DateAdd(DatePicker1.SelectedDate,4,Days),
Weekday(DateAdd(DatePicker1.SelectedDate,3,Days)) >6,
DateAdd(DatePicker1.SelectedDate,5,Days),
DateAdd(DatePicker1.SelectedDate,3,Days))


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Community Support Team
Community Support Team

Re: Duedate but will not be counted on Saturday and Sunday

Hi @giangnguyen ,

 

Do you mean Submission Time as Start Date, then add three days as Due Date and exclude weekends day?

You could refer to the following method to configure Flow.

  • Initialize three variables, Date is used to indicate the date that may be included in the task, Number is used to control the loop, and the last variable is used to record valid Dates.
  • Use dayOfWeek() function to exclude Saturday and Sunday and append the valid date to the array.
  • Each loop requires a day plus of Date.

Expression reference:

 

formatDateTime(body('Get_response_details')?['submitDate'],'yyyy-MM-dd')
dayOfWeek(variables('Date'))
addDays(outputs('CurrentDate'),1,'yyyy-MM-dd')

Image reference:

 

4.PNG

Details of Apply to each:

5.PNG

Details of Do Until:

7.PNG

Details of Condition:

8.PNG

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 330 members 2,782 guests
Please welcome our newest community members: