Power Automate reacts perfectly when things change in Microsoft Planner. For example, we have a trigger that will fire “When a task is completed”, which can be used for things like:

  1. Notify people that a task has finished.
  2. Trigger an authorization “When a task is completed” to move forward in the workflow.
  3. If you’re writing an article, for example, Flow can archive the working Folder and upload the article to your CMS when it’s finished.

There are a lot of things that can happen if the task being completed is the trigger. So let’s check in more detail on how it works.

Where to find it?

To find it, you can search for the “When a task is completed” action.

You can find the “When a task is completed” action under Microsoft Planner.

Pick the option.

Here’s what it looks like.

Pro Tip:
Power Automate tends to save the most common triggers in the main screen, so check there before going trough the full hierarchy. Also you can use the search to quickly find it.

The trigger is super simple to set up. You need to point it to the group and Plan, and you’re ready to go.

Usage

The Flow will trigger only when a task is marked as completed either by pushing the complete button or selecting the “Completed” in the “Progress”.

That’s it. Not a lot more to think about.

Outputs

The trigger returns a lot of information in a JSON format, although the conversion from JSON is done automatically for you. Here’s an example:

{
    "headers": {
        <redacted>
    },
    "body": {
        "@odata.etag": "W/\"JzEtVGFzayA=\"",
        "planId": "fa-pZcAHT7g",
        "bucketId": "fPjsGArNo-",
        "title": "test 3",
        "orderHint": "8585770537681000160PV",
        "assigneePriority": "",
        "percentComplete": 100,
        "createdDateTime": "2021-06-24T16:46:17.4713108Z",
        "hasDescription": true,
        "previewType": "reference",
        "completedDateTime": "2021-10-04T12:43:26.6364817Z",
        "referenceCount": 10,
        "checklistItemCount": 20,
        "activeChecklistItemCount": 20,
        "id": "jaarcIS_AEKwFmsSMr5LcpcAHH-6",
        "createdBy": {
            "user": {
                "id": "691d3181-d794-44fb-aba1-a267da4f229f"
            }
        },
        "completedBy": {
            "user": {
                "displayName": null,
                "id": "e5a88596-2510-11ec-9621-0242ac130002"
            }
        },
        "appliedCategories": {},
        "assignments": {},
        "_assignments": []
    }
}

We’ll ignore the headers since they don’t have much helpful information for us.

The task is closed regardless of the Flow fails or not. The trigger fires after the task are closed. You can use the “Update a task” action to change its state if you want, but be careful to make that clear to everyone; otherwise, people will be closing tasks that will never close.

The trigger will return the basic information of the task without its details—the counts for the checklist and references, who created and updated it. If you need more information, you can always use the “Get a task” or the “Get a task details” actions.

Limitations

There’s no documented limitation for this trigger, but please let me know by email or interact on Twitter if you know one.

Recommendations

Here are some things to keep in mind.

Never generate the Group or Plan ID.

You should never generate IDs manually. I understand that there may be cases where the task may be inserted in one Plan or the other. For example, you have the same task but could go to a department or another to parse depending on the content. Even in these cases, pick the group and plan manually and generate multiple actions if you have to.

Tools change, and IDs change with them. So you should never have even to know what’s the ID of a Group or Plan.

Finally, having the IDs will make debugging more challenging because you don’t have the description of the Plan to guide you.

Name it correctly

The name is super important in this case since we can get the trigger from anywhere and with anything. Always build the word so that other people can understand what you are using without opening the action and checking the details.

Always add a comment.

Adding a comment will also help to avoid mistakes. Indicate what you’re expecting, why the Flow should be triggered, and the data used. It’s essential to enable faster debugging when something goes wrong.

Am I missing something? Leave a comment or interact on Twitter. Let’s work together to make this reference as complete as we can

Back to the Power Automate Trigger Reference.

Photo by JOSHUA COLEMAN on Unsplash

Manuel Gomes

I'm a Project Manager with experience in large projects and companies. I've worked in the past for companies like Bayer, Sybase (now SAP) and I'm currently working for Pestana Hotel Group.

View all posts by Manuel Gomes →

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: