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

Flow updates Planner with responses to Form: I want to set the deadline to 3 working days away.

Hi everyone, I hope someone can help me,

 

I'm creating a Flow which takes responses to a Form and creates a task in Planner for the relevant team.  I want to set it so that it will automatically work out the Due Date as 3 working days away.  I know that the 'workday' function from Excel doesn't work so I worked out that all days need to be set to add 3 days except for Wednesday and Thursday which need to add 5 and 4 days respectively.  I tried to create the following expression using nested ifs but I keep getting an invalid expression error message:

 

if(utcNow('dddd')="Wednesday",addDays(outputs('Get_response_details')?['body/submitDate'],5),if(utcNow('dddd')="Thursday",addDays(outputs('Get_response_details')?['body/submitDate'],4),addDays(outputs('Get_response_details')?['body/submitDate'],3)))

 

Any support I can get with this flow would be highly appreciated.

 

Cheers in advance 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Flow updates Planner with responses to Form: I want to set the deadline to 3 working days away.

 

Hi @ShaunSmith ,

 

First, the expression does not support the use of "=", you need to use equals() function instead of "=".

Second, you cannot use "" here, you need to use ''.

Please use this expression:

if(equals(utcNow('dddd'),'Wednesday'),addDays(outputs('Get_response_details')?['body/submitDate'],5),if(equals(utcNow('dddd'),'Thursday'),addDays(outputs('Get_response_details')?['body/submitDate'],4),addDays(outputs('Get_response_details')?['body/submitDate'],3)))

 

In addition, SubmitDate is a problem in Forms? If so, the way you quote this answer in expression seems a bit problematic.

You should be able to get this value directly through Dynamic content, you don't need to get it through outputs ('Get_response_details')? ['Body / submitDate'].

Like:

70.PNG

Then you just need to configure expression with the output of Compose.

Like:

61.PNG

if(equals(utcNow('dddd'),'Wednesday'),addDays(outputs('Compose'),5),if(equals(utcNow('dddd'),'Thursday'),addDays(outputs('Compose'),4),addDays(outputs('Compose'),3)))

 

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
Community Support Team
Community Support Team

Re: Flow updates Planner with responses to Form: I want to set the deadline to 3 working days away.

 

Hi @ShaunSmith ,

 

First, the expression does not support the use of "=", you need to use equals() function instead of "=".

Second, you cannot use "" here, you need to use ''.

Please use this expression:

if(equals(utcNow('dddd'),'Wednesday'),addDays(outputs('Get_response_details')?['body/submitDate'],5),if(equals(utcNow('dddd'),'Thursday'),addDays(outputs('Get_response_details')?['body/submitDate'],4),addDays(outputs('Get_response_details')?['body/submitDate'],3)))

 

In addition, SubmitDate is a problem in Forms? If so, the way you quote this answer in expression seems a bit problematic.

You should be able to get this value directly through Dynamic content, you don't need to get it through outputs ('Get_response_details')? ['Body / submitDate'].

Like:

70.PNG

Then you just need to configure expression with the output of Compose.

Like:

61.PNG

if(equals(utcNow('dddd'),'Wednesday'),addDays(outputs('Compose'),5),if(equals(utcNow('dddd'),'Thursday'),addDays(outputs('Compose'),4),addDays(outputs('Compose'),3)))

 

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

ShaunSmith
Level: Powered On

Re: Flow updates Planner with responses to Form: I want to set the deadline to 3 working days away.

Hi Barry,

 

This is brilliant, thank you.  I'm quite new to Flow so I'm still not 100% on the difference in syntax between it and Excel.  As you mentioned below the expression didn't work directly in the 'Create task' Action, however I was able to put this straight into an Output Action and it works as intended.

 

For clarification I didn't actually type in 'outputs ('Get_response_details')? ['Body / submitDate']', that is how the dynamic content appeared in the expression when I was trying to input it.

 

Thanks again for your help!

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

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

Top Solution Authors
Top Kudoed Authors
Users online (5,280)