web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Changing Planner label...
Power Automate
Unanswered

Changing Planner labels based on due date - timeouts

(0) ShareShare
ReportReport
Posted on by 13

This Flow is meant to update the labels of Planner tasks based on the due date, eg to label a task as 'within 7-14 days' when that condition arises, and to remove it again when it doesn't (ie as time passes).

The issue is that it runs, and does update tasks, but it just keeps running. The run history shows a duration of often over 20 minutes and status is always 'running'. Power Automate provides this warning:

Your flow's performance may be slow because it's been running more actions than expected since 11/19/2021 1:31:57 AM (1 week ago). Your flow will be turned off if it doesn't use fewer actions. Learn more

 

Recurrence is set to 1 hour. Filter array filters out completed tasks. The Condition checks a due date had been entered.

TobyV_0-1637902615641.png

It's somewhere here that it gets stuck.

If yes (due date â‰  null) it checks the due date of the filtered array to see if it's in a range. I use utcNow(). For example to get 7 days away, I use addDays(utcNow(), 7) 

TobyV_3-1637903137441.png

 

if yes it updates the labels accordingly:

TobyV_4-1637903201007.png

 

Any advice much appreciated! As I say it does work, but doesn't stop running. Thanks very much in advance

Categories:
I have the same question (0)
  • Verified answer
    efialttes Profile Picture
    14,756 on at

    Hi!
    How many tasks is your 'Apply to each' processing?
    My suggestion is to add a 'Compose' action block just after the 'Filter array', assigning as its value the following WDL expression, just to doubleckeck the nr of tasks that are to be processed 

     

    length(body('Filter_array'))

     

    From my experience, nested 'Condition' action blocks inside an 'Apply to each' are very unefficient. Did you consider adding a more complex WDL expression in your filter array, in order to consider all the conditions that shall be met? Just click on 'Edit in advanced mode' to be able to add a more complex expression, concatenating condition rules by means of and() function
    Hope this helps

  • TobyV Profile Picture
    13 on at

    Thank you! I pulled out the nested conditions and it works! I added a timeout function to stop it just in case. Thanks again!

  • RobA1 Profile Picture
    18 on at

    Can you please paste your whole solution here. I am new to Power Automate and not having much luck accomplishing the same thing here? Thank you...

  • TobyV Profile Picture
    13 on at

    Sure, though I'm relatively new to this too, so there may be a better solution (but this works for me).

     

    The first few actions at the top are the same (Recurrence > List Tasks > Filter Array). Then instead of a Condition, I filter that array with another Filter Array to remove null due dates: 

    TobyV_0-1646719368814.png

    Then I add my Condition. This one find tasks in a date range from the second filtered array. If yes, add an Update a task V2 action (renamed to "Make label red..." below):

    TobyV_1-1646719557704.png

    You can then create subsequent actions below this for any date ranges you have, just making sure the Task ID field is always looking up the second filtered array.

     

    Another tip: as a failsafe I added a parallel action after the 2nd filtered array that stops the flow after 30 mins:

     

    TobyV_2-1646719903685.png

    If you do this last step though all runs in your run history will always appear as 'cancelled', not 'complete'. You could ignore this in the first instance and see if everything runs without long run times though.

     

    Hope this helps

  • RobA1 Profile Picture
    18 on at

    Thank you for your response. I followed exactly what you did with no luck. I believe the issue may be within the Condition. The result ends up to be false with no record past...

    RobA1_0-1646934496180.png

     

    In the first Condition, I have 

    DueDateTime   is greater than or equal to addDays(utcNow(), 7)

    DueDateTime   is less than or equal to addDays(utcNow(), 14)

     

    Here it is as follows:

    RobA1_1-1646934763371.png

     

     

    Any thoughts?

     

    Thanks Again....

  • TobyV Profile Picture
    13 on at

    Hm, not entirely sure but maybe check in 'Apply to each 2' you're looking up:

    • the 'Body' from your second filtered array and
    • each 'Due Date Time' from 'Apply to each 2'

    Then also that your 'if yes' is also looking up the ID from 'Apply to each 2'. You'll see that your 'if yes' has another 'apply to each' inside it (can be automatically added by Power Automate) where mine doesn't. Although in your run the issue occurs before this.

     

    Myself I'd try rebuilding the condition top down and see if that works. Failing that could it be a testing issue? Eg making sure the dates are entered correctly in your tasks before testing. Just a thought.

  • RobA1 Profile Picture
    18 on at

    It works! I ended up rebuilding it and that did it. Awesome!!! Thank you so much for your help with this...

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard