cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tomjedig
Helper II
Helper II

Mark a Planner task as completed when the due date passed

Hello everyone, I want to create a Flow that marks Planner tasks as completed if the due-date is passed.
I made this now but it doesn't mark tasks that were due yesterday as completed.

The condition is:
if due date is equal to addDays(utcNow(),1,'yyyy-MM-dd')

help.PNG

Thanks for your help 🙂

1 ACCEPTED SOLUTION

Accepted Solutions

@tomjedig  this is because in some task you don't have a duedate added so you are trying to compare and empty value with your expression. 

 

Please look for the task without due date.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

18 REPLIES 18
ChristianAbata
Super User
Super User

hi @tomjedig  please try with this fuction with an hour getFutureTime(5,'Hour','yyyy-MM-ddThh:mm:ss') or add to your fuction an hour



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

@ChristianAbata Is that to make it 5 hours ahead? I want the Flow to mark the task if 24 hours passed, eg. the task is due on the 26th and it marks it on the 27th.

shure @tomjedig  you can change it by 24, see

24.PNG12.PNG



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
efialttes
Super User
Super User

Hi!
You can try by replacing 'equals' operator and using 'contains' instead, keeping your current expression as it is right now
Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



 
 

Unfortunately @ChristianAbata's suggestion doesn't work and I can't find any errors.

For 

Hi!
The error... It looks like you have at least one task without Due Date assigned, right?

Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Yeah I have a few. I'm building this for for school to "hide" tasks that were due in the past. So there will be a few tasks due on one date every week.

Hi again!

On your Condition rule, try to replace 'due date' dynamic content and assign this expression instead:

 

coalesce(item()?['dueDateTime'],'NoDueDate')

 

...so in case of no DueDate, it takes value NoDueDate for comparison purposes

If problem persists, try to use this other expression

if(empty(item()?['dueDateTime']),'NoDueDate',item()?['dueDateTime'])

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Hi, both expressions don't work, I tried them with both contains and equals.

Do you have another idea for a flow that marks tasks that we due yesterday as completed? I'm using Power Automate only for a few days and maybe this wasn't the easiest way.

hi @tomjedig I repply your scenario and I do this

 

1.- I create 2 task in my planner the frist one with current date 26 and another with yesterday start time.

2.- In flow I did this

solves.PNG

 

As you see in first I list all tasks, and then use a condition go get just the task not completed even not started, so if you want to get the started you can use 50 in the compare if value.

3.- Then I add another condition to compare my startDateTime task to my actual date time using this expresion

 

formatDateTime(utcNow(),'yyyy-MM-dd')

 

and it works, I get 1 true value for the task that was created for yesterday and a false value for the value today.

 

Hope this can helps.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Hi @ChristianAbata, I re-built this now, btu with the due date instead of the start date, as I want to mark tasks that were due yester or even longer ago as completed.
Everything worked, but it says I've got an error. Would it help to remove the first condition? All my Planenr tasks have the same state (except the ones that are already completed). I still have to decide whether to set new created tasks to "in progress" or "not started".Unbenannt.PNG

shure my friend @tomjedig  please see this gif.

 

detele.gif

 

Please consider to mark my answer as solution 😉 a like could be great to.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

I still got the an action failed error for the first condition 😞
The flow works, the tasks get marked as completed but it shows that it got an error 😕

please show us the error @tomjedig 



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

Oops, forgot to attach the screenshot.error.PNG
I've got another idea: what about making the condition like this? If due date is equal to 

getPastTime(24,'Hour','yyyy-MM-ddThh:mm:ss')

I tried the idea that I said at the end of my message, it doesn't work.
So we have to fix that error somehow 🤔

@tomjedig  this is because in some task you don't have a duedate added so you are trying to compare and empty value with your expression. 

 

Please look for the task without due date.



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA

View solution in original post

@ChristianAbata That fixed my error now. Thanks for all the help 🙂

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,036)