cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MargeNL
Frequent Visitor

due date needs to be on workdays only

Hellimage.pngo all,

 

I'm building a flow that creates a Planner task. User has 5 workdays to complete the task. So, therefor the due date most always be a workday. 

Who can help me with this?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Yes! I think I worked it out.

 

Used this: 

if(or(equals(dayofweek(utcNow()),4),equals(dayofweek(utcNow()),5)),addDays(utcNow(),5),addDays(utcNow(),7))
 

 

 

View solution in original post

6 REPLIES 6
v-litu-msft
Community Support
Community Support

Hi @MargeNL,

 

If is the due date always 5 days? If it always 5 days, you can add two more days at the End date field.

If it not always 5 days, you can judge the start date whether is Thursday or Friday by using the dayOfWeek() function, if it is, add two more days, if not, no need to add.

 

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

Thank you. Sometimes things are so simpel!

Hold on.

I get the two extra days in case of 5 workdays.

 

How do I use the dayOfWeek function in case of 3 workdays?

Thanks for your patience.

Hi @MargeNL,

 

If the due date is 3 workdays, you can also judge the start day whether is Thursday or Friday.

If it is, End date = Start Date + 5 days.

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

Thank you, I understand that.

What I would like to learn/know is how to have the Flow Judge whether the start day is a Thursday or Friday.

 

Yes! I think I worked it out.

 

Used this: 

if(or(equals(dayofweek(utcNow()),4),equals(dayofweek(utcNow()),5)),addDays(utcNow(),5),addDays(utcNow(),7))
 

 

 

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (3,285)