Creating Planner Plans using Power Automate

Currently, the Microsoft Planner connector for Power Automate/Power Apps does not have a ‘Create Plan’ action. There are options to manage tasks and buckets, but when it comes to plans, there are only actions to list content.

Alternatives to create a plan

We can use the graph API to create Planner plans. Previously, to use the Graph API in Power Automate, we would need to either use one of two premium connectors: the HTTP action (managing the authentication and all of that to connect to Graph manually), or using the HTTP with Azure AD action. Or even, it can be done by building a custom connector.

New action under the Office 365 groups connector

But recently a new action was released in preview under the ‘Office 365 groups’ connector: Send an HTTP request.

This action was intended to be used to make calls to the Graph API, in a similar way as the ‘Send an HTTP request to SharePoint’ is used to make calls to SharePoint Rest API (and for the moment it seems this action will stick to the standard connectors, which will open a lot of new automation possibilities).

How to make a call to graph and create a plan using the new action

The request is simple enough. We need to do a POST request against the planner plans endpoint: https://graph.microsoft.com/v1.0/planner/plans

Using two parameters only:

  1. The id (guid) of the group: (Microsoft 365 group – not security groups) where the plan will be created, easily found on Azure AD:
  2. The plan name:

Then to create a plan, use the following request format:

{
        "owner": "Group Id here",
        "title": "Plan title"
}

Add the ‘Send an HTTP request’ action under the Microsoft 365 groups connector, and use the format specified above to create Plans:

Results:

After calling the action, when the plan is successfully created:

Details about the plan are returned and can be used to automate more steps, such as adding tasks to the plan using the recently created plan.

31 comments

  1. Michel,

    was looking for a more simple creating without “graph”.

    thanks it works,

    small question, how to parse the reponse body, so i can use the response for further use.

    1. Hi Jan,

      At the moment the only way to do it is using Graph…To parse the response you can use the ‘Parse JSON Action’ with the response from the Graph call and the following schema (:

      {
      "type": "object",
      "properties": {
      "@@odata.context": {
      "type": "string"
      },
      "@@odata.etag": {
      "type": "string"
      },
      "createdDateTime": {
      "type": "string"
      },
      "owner": {
      "type": "string"
      },
      "title": {
      "type": "string"
      },
      "id": {
      "type": "string"
      },
      "createdBy": {
      "type": "object",
      "properties": {
      "user": {
      "type": "object",
      "properties": {
      "displayName": {},
      "id": {
      "type": "string"
      }
      }
      },
      "application": {
      "type": "object",
      "properties": {
      "displayName": {},
      "id": {
      "type": "string"
      }
      }
      }
      }
      }
      }
      }

      1. Michel,

        Thanks for your great write up.

        I am having an issue when parsing the body response. I am finding that the “id: {” values are being returned in the body output of the HTTP request however they are showing as null variables when using Parse JSON Action. Meaning that creating a Bucket fails as the PlanID passed is null.

        Is there another way to grab the newly created PlanID?

        Pete

        1. Hi Pete,

          That’s weird, when you investigate your flow run, does this value appear in the outputs of the HTTP action?

          You can also access the value directly in an expression without parsing the JSON content if needed, for example:
          body('Send_an_HTTP_request')['id']

  2. Hi Michel,

    Thanks for coming back to me. Yes, the value appears in the HTTP output but after parsing it would show up as NULL, must be an issue in my schema, however I can’t seem to find the problem.

    However, your method to grab the variable by adding it in the expression works great. I can now access and manipulate my new Planner Plan and create buckets and tasks associated with it.

    Thank you again for your help.

    Pete

    1. Hi Pete,

      It seems it’s a problem with your schema…

      But great you could make it work with the alternative approach 😉

  3. I have been searching for hours, where is this connector? It’s not listed under anything I see and I have been everywhere in our business’ apps to try to find it. Under outlook groups add a connector there is nothing that looks like this. If you try to add one the only thing you get is connectors for team. Please help. I am trying to get it to automate so where we create an item on a list, it a) creates a teams channel with the same name (done) and b) creates a plan of the same name that is under planner and connected in teams under the channel.

    1. Hi Annie, this action is under the ‘Office 365’ groups connector…
      You will need to also manage to add the plan as a tab so, which will be a separate task…

  4. Thank you for the great post, but I am getting an error – “You do not have the required permissions to access this item, or the item may not exist.”

    Here is what I did as a simple test (and if someone has a more elegant solution to get the GroupID, I’m all ears). Please note that although this was a test, assume this is within a Flow that also creates a new Team and Group, so I needed a way to grab the new GroupID as part of the flow :

    – Manual Input
    – Groups Connector
    – Action: Send an HTTP request
    ** URI – https://graph.microsoft.com/v1.0/groups/?$filter=displayname+eq+'%5BGroupDisplayName%5D
    – Run Test and Copy output
    – Add Action: Parse JSON
    – Hit “Generate from sample” and past Output. Use ‘Body’ from “Sent an HTTP request” as content.
    – Initialize String Variable (varGroupID)
    – Action: Compose = item()[‘id’]. This will create an “Apply to each”
    – Action: Append to string variable. Write the Compose Output to varGroupID
    – Use varGroupID as the “owner” in the code listed in this post.
    – Flow fails at this second “Send an HTTP request” – “You do not have the required permissions to access this item, or the item may not exist.”

    Thanks in advance.

    1. Hey Mark, as we discussed on Twitter, the issue was that you were using a security group and not a Microsoft 365 group…just adding the comment here for visibility in case someone has the same issue

      1. I am using a M365 group, but I am still getting this error : You do not have the required permissions to access this item, or the item may not exist.

  5. Hi Michel – this was very helpful, I successfully followed the steps to create the plan, thanks much!! In the same flow I’d like to add a bucket to the plan and put some tasks into that bucket. I added a Delay step (5 minutes, to allow for the Plan to properly get created) and after that I’ve tried a bunch of different steps that all have failed so far. I think the problem is that I’m not pulling in the Group ID and the Plan ID correctly. What steps do you recommend for creating a bucket and tasks for the just-created Plan?

    1. Hi Val, for the group ID you can use the same ID you used to create the plan.
      To retrieve the plan ID you can use the Parse JSON action and the same schema I mentioned in a comment above, or you can use or use an expression in a compose action to retrieve it from the previous action, ex: body('Send_an_HTTP_request')['id']

      1. Can you be more clear on how to find the ID used in the first step. I read thru the commments and don’t understand how to find this.

  6. Hi Michel, very good post. Can you tell me if it is possible to create a planner from a “template” with specific buckets?

    1. Hey Henver…At the moment there is no straightforward way to do it in a single call, but you could use the output from this HTTP action to get the plan ID, then use the Planner Power Automate actions to create the Buckets. Is that what you were looking for?

  7. Hey Michel,
    thanks for this great post. I just spend quite a lot of time to get annoyed by Microsoft-oddities:
    do you happen to know, why creating a plan works fine with “Send an HTTP request”, but fails with “Send an HTTP request V2 (preview)”?

    This could mean the old version might – at some point – be ditched and it wouldn’t work with the newer version…

    Marc

    1. Hey Marc,
      My undestanding is that yes, that could happen. It seems the planner endpoint is not supported by the V2 action…

  8. Hi MIchel,

    Thanks for this great post. In my flow I am indeed able to create the planner in the background, however I still need to manually add it to the general channel of the newly created team site. Can you share if and how it is possible to add the newly created planner as a tab in the team channel general?

    Jeroen

  9. Hi Michel,

    Thanks for your detailed how-to. I received an error message: URI path is not a valid Graph endpoint, path is neither absolute nor relative or resource/object is not supported for this connector. Resources: me,users Objects: messages,mailFolders,events,calendar,calendars,outlook,inferenceClassification. Uri: https://graph.microsoft.com/v1.0/planner/plans

    Any advice on how to handle this?
    Thanks!
    Michelle

    1. Hi Michelle,

      Try with the V1 of the HTTP action, the preview one has less segments available and you will get this error message if using it.

      Let me know how it goes,

      Michel

  10. When I try to run this in Power Automate I get the error – URI path is not a valid Graph endpoint, path is neither absolute nor relative or resource/object is not supported for this connector. Resources: me,users Objects: messages,mailFolders,events,calendar,calendars,outlook,inferenceClassification. Uri: https://graph.microsoft.com/v1.0/planner/plans.

    When I go to – https://developer.microsoft.com/en-us/graph/graph-explorer – and run my request, I get an error that says – “This entity set must be queried with a filter on owner property, or container type and container external id, or contextScenarioId”,

    1. Hey Julie,

      Are you using the V1 of the HTTP connector? This method only works with this version.

      What params are you using in Graph explorer, what is the request body?

Leave a Reply

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