Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

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

  • RobA1 Profile Picture
    18 on at
    Re: Changing Planner labels based on due date - timeouts

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

  • TobyV Profile Picture
    13 on at
    Re: Changing Planner labels based on due date - timeouts

    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
    Re: Changing Planner labels based on due date - timeouts

    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
    Re: Changing Planner labels based on due date - timeouts

    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
    Re: Changing Planner labels based on due date - timeouts

    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
    Re: Changing Planner labels based on due date - timeouts

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

  • Verified answer
    efialttes Profile Picture
    14,756 on at
    Re: Changing Planner labels based on due date - timeouts

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,635 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow