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.
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)
if yes it updates the labels accordingly:
Any advice much appreciated! As I say it does work, but doesn't stop running. Thanks very much in advance
It works! I ended up rebuilding it and that did it. Awesome!!! Thank you so much for your help with this...
Hm, not entirely sure but maybe check in 'Apply to each 2' you're looking up:
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.
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...
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:
Any thoughts?
Thanks Again....
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:
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):
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:
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
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...
Thank you! I pulled out the nested conditions and it works! I added a timeout function to stop it just in case. Thanks again!
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
WarrenBelz
146,635
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional