December 27, 2024

Planner’s “Get task details” action is the go-to action when it comes to actions. It fetches all information for a specific task so that we can parse the data.

Where to find it?

You can find the actions related to Microsoft Planner in the “Standard” section:

There you can find the “get task details” action:

Here is what it looks like:

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

Usage

Planner’s “Get task details” action is the best friend for the “When a new task is created” trigger. When it triggers, it only returns the information from the created task; we only have its ID and not a lot more. We need the task information, and the action returns that. You can use it everywhere you have a task id and need the details of that task.

Let’s pick a task that I already have in the dropdown:

We’ll get the following information:

  1. Description
  2. ID
  3. References
  4. Checklist items

I’ve added a few items and attachments, so this is what we’ll get:

Here’s an example for two references, the first an URL and the second a file that we upload to the task:

[
  {
    "resourceLink": "https://manueltgomes.com/area/microsoft/planner/",
    "value": {
      "@odata.type": "#microsoft.graph.plannerExternalReference",
      "alias": "Planner Section",
      "type": "Other",
      "previewPriority": "8585735944ZA",
      "lastModifiedDateTime": "2021-08-03T17:40:33.5165123Z",
      "lastModifiedBy": {
        "user": {
          "displayName": null,
          "id": "b6a1A137-2a63-4713-b3b9-1a43baA739fb"
        }
      }
    }
  },
  {
    "resourceLink": "https://manueltgomescom.sharepoint.com/sites/ToDoList/Documentos Partilhados/small-Screenshot_2021-08-03_at_18_35_34.jpg?web=1",
    "value": {
      "@odata.type": "#microsoft.graph.plannerExternalReference",
      "alias": "small-Screenshot_2021-08-03_at_18_35_34.jpg",
      "type": "Other",
      "previewPriority": "8585735945119764848Pp",
      "lastModifiedDateTime": "2021-08-03T17:40:33.5165123Z",
      "lastModifiedBy": {
        "user": {
          "displayName": null,
          "id": "b6a1A137-2a63-4713-b3b9-1a43ba47A9fb"
        }
      }
    }
  }
]

As you may have noticed, there are no attachments stored in Planner. Only references. Each has its priority in the list, the information of the user, the link, and the alias to display in the task. You can use these values in Power Automate for your automation.

Here’s an example for two checklist items:

[
  {
    "id": "35380",
    "value": {
      "@odata.type": "#microsoft.graph.plannerChecklistItem",
      "isChecked": false,
      "title": "Checklist item 2",
      "orderHint": "85857359453e",
      "lastModifiedDateTime": "2021-08-03T17:39:44.4387484Z",
      "lastModifiedBy": {
        "user": {
          "displayName": null,
          "id": "b6aA9137-2a63-4713-b3b9-1a43bA4739fb"
        }
      }
    }
  },
  {
    "id": "43106",
    "value": {
      "@odata.type": "#microsoft.graph.plannerChecklistItem",
      "isChecked": false,
      "title": "Checklist item 1",
      "orderHint": "8585735945652938647P)",
      "lastModifiedDateTime": "2021-08-03T17:39:40.2305869Z",
      "lastModifiedBy": {
        "user": {
          "displayName": null,
          "id": "b6a191A7-2a63-4713-b3b9-1a43ba47A9fb"
        }
      }
    }
  }
]

We have the type (checklist), the order, title, and if it’s checked for the checklist items. Finally, you have the name of the user that created them. Some of the fields may not look useful, but we’re glad that they are returned. We never know when we need them, so it’s better to ignore them than not have them.

Limitations

Each task has a lot more information than above, like:

  1. bucket
  2. progress
  3. priority
  4. Start and end date

You have to use the “Get task” action to get this information, but it will not return the description, checklist, or attachments. It’s strange that Microsoft decided to break the information into two actions and what they chose for each, but we have all information covered in these two actions.

Recommendations

Here are some things to keep in mind.

Never generate the ID yourself.

Always get the ID either from a trigger or from another action. Never try to generate the ID yourself since they may change, and then your Flow will fail.

Name it correctly

The name is super important in this case since having only “get task details” doesn’t tell us much. Always build the name 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 where the task that you’re trying to get (or the context). It’s important to enable faster debugging when something goes wrong.

Always deal with errors.

Have your Flow fail graciously when the task doesn’t exist and notify someone that something failed. It’s horrible to have failing Flows in Power Automate since they may go unlooked for a while or generate even worse errors. I have a template, and a template that you can use that will help you make your Flow resistant to issues. You can check all details here.

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 Action Reference.

Photo by Eden Constantino on Unsplash

Manuel Gomes

I have 18 years of experience in automation, project management, and development. In addition to that, I have been writing for this website for over 3 years now, providing readers with valuable insights and information. I hope my expertise allows me to create compelling, informative content that resonates with the audience.

View all posts by Manuel Gomes →

Leave a Reply

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

Mastodon