Skip to content

Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Problems
  • Triggers
  • Application specific solutions
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
Menu

Flow when Planner task in specific bucket is completed (Power Automate)

Posted on June 30, 2021June 30, 2021 by Tom

“Is there a way to create a Power Automate flow that would send an email only when a task in a specific Planner bucket is completed, and ignore the rest?“


The Planner trigger ‘When a task is completed’ doesn’t give you too many options. You can select the ‘Group Id’, the ‘Plan Id’, and that’s it. There’re no additional options for further filtering among the tasks, all the completed tasks will trigger the flow. Power Automate doesn’t care if the completed task was from one or another Planner bucket. But that doesn’t mean that you can’t build such functionality by yourself.

Get the bucket name

When you check the output of the ‘When a task is completed’ trigger, you’ll notice that the bucket is provided as an id. If you knew the id of the bucket, you could use the ‘bucketId’ value directly. But in this chapter we’ll turn the ‘id’ into bucket ‘name’ that’s easier to work with.

The first step to get the bucket name is to ‘List all buckets’ in the plan. As with the trigger, you can’t filter the buckets directly, you must take all of them and filter them later. Take the output from ‘List all buckets’ and filter the bucket whose ‘id’ is equal to the ‘bucketId’ with the ‘Filter array’ action.

Power Automate completed Planner task bucket

The sole output from the ‘Filter array’ action will be the corresponding bucket, whose ‘name’ you can use.

You can use it in a ‘Condition’ (email only for a specific bucket), or in a ‘Switch’ (different email for various buckets), it’s up to you. You’ve got the bucket name and you can easily use it in the flow.

Power Automate completed Planner task bucket

Note: don’t worry about the ‘Apply to each’, the output from ‘Filter array’ will be always only 1 bucket.

Use trigger condition with bucketId

The second, more advanced option is to use a trigger condition. If you want to process completed tasks only from a single bucket, you don’t have to trigger the flow for each task and search for the bucket name. You can use a trigger condition instead and trigger the flow only for tasks from that bucket. But you’ll need to know the ‘bucketId’ for that.

As already shown in the post on importing tasks in various buckets, you can get it from the ‘List buckets’ action. List all buckets, search for the desired one in that actions output, and take its id. Use it in a trigger condition that will trigger the flow only if the completed action bucketId is the same, e.g.

@equals(triggerOutputs()?['body/bucketId'], 'J7JTnbyxxxxxIPZ6IWO5gAFCK_')

Summary

You’ve got (at least) two options how to recognise the bucket of a completed Planner task with Power Automate. The first option is better if you’d like to somehow process tasks from more/all buckets. With each run it’ll check the bucket of the task and act accordingly. It doesn’t matter that it’ll trigger with each completed task as you process them anyway.

The second option is better if you’re interested only in a specific bucket. You don’t need to trigger the flow for each completed task, but only for some of them. It’s a bit more complicated as you must get the bucketId and create the trigger condition, but it’ll save a few actions in the flow, not to mention a few flow runs.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Now available:

The Ultimate Power Automate expressions cheat sheet
Equip yourself with the tool to translate your thoughts into Power Automate expressions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Format results of date calculation in SharePoint columnJune 29, 2022
  • Why is your Power Automate flow creating duplicatesJune 26, 2022
  • How to create a unique identifier in your Power Automate flowJune 22, 2022
  • How to assign custom SharePoint permission level with Power AutomateJune 19, 2022
  • Remove permissions from a specific SharePoint user with Power AutomateJune 15, 2022

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

© 2022 Let's POWER Automate | Powered by Superbs Personal Blog theme