Import Planner tasks into various plans/buckets with Power Automate
Posted On May 30, 2021
“Is there any way I could fill-in buckets and plans directly in an Excel sheet so I could use only one file to create Planner tasks in as many plans as I need with Power Automate?”
I already published a post on importing tasks from Excel to Planner with Power Automate, but the solution is importing all the tasks into the same place. Every row in the Excel table will be taken and imported into the predefined plan and bucket. But what if you don’t want all the tasks in the same plan/bucket? If you want to use a single Excel file with all the tasks for multiple plans and/or buckets? How can you tell Power Automate which plan and which bucket to use for each of the tasks?
Use the group/bucket/plan IDs
Power Automate works with the IDs of the Planner groups, plans and buckets, not with their names. You can see that if you configure the ‘Create a task’ action and then switch to ‘Peek code’. There’s a ‘groupId’ for the M365 group, ‘planId’ for the plan and ‘bucketId’ for the bucket. There isn’t any name except the task title.
To import tasks from an Excel file into various plans/groups/buckets you’ll need their ID.
Get the groupId and planId
The ‘groupId’ and ‘planId’ are easy to get from the url in the plan. Just open the plan in your browser and take it from there, ‘groupId’ is after ‘groupId=’ and ‘planId’ after ‘planId=’.
Get the bucketId
It’s not so simple with ‘bucketId’ as that one doesn’t appear in the url. But you can use the Power Automate action ‘List buckets’ to get it as a workaround. If you add the action to your flow and run it, you’ll see in the run history all the available buckets and their information. Among it will be the bucket ‘name’ and the ‘bucketId’ (under the ‘id’ key).
"name": "Tomas test bucket",
Find the right bucket by its name, take its ID and add it to your Excel import file.
The solution above describes how to use Power Automate to import Planner tasks from Excel into various groups, plans and buckets. It’s important to understand that Power Automate doesn’t work with names, it works with IDs. It’s because names can change, and a small change in the name could break your flow. But IDs stay the same from the moment you create the group, plan or bucket.
It’s also not necessary to store all the values in the import Excel sheet. If you’re creating tasks only in a single plan, you can preselect it in the action and store only the ‘bucketId’ in the sheet.
And it’s not limited only to Excel files, you can use the same solution also to import tasks from a SharePoint list. Just add the Ids to each of the items and it’ll work in the same way.