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.
2 REPLIES 2
Super User
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.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Users Online
Currently online: 221 members 3,971 guests
Recent signins:
Please welcome our newest community members: