Skip to main content
Community site session details

Community site session details

Session Id : WiPSlkdMsLReoeX/1aaenC

Copy Planner task from one plan to another, towards the same bucket name

frederikbisback Profile Picture frederikbisback 222

Intro

Getting into planner for managing the work of your teams, but you are lost in the total overview! Centralize the planning of your teams by creating them in an automated way toward a plan that will contain all teams.

Need more information about Microsoft Planner: LINK

Take the chaos out of teamwork and get more done! Planner makes it easy for your team to create new plans, organize and assign tasks, share files, chat about what you’re working on, and get updates on progress.

How-to?

In Planner you have for example a plan of a team and a second plan that will be the centralized plan of other teams.
Source: TEST FBI - PLANNER01
Central: TEST FBI - PLANNER02

Planner01.pngPlanner02.png

Three buckets created, that can visualize the planning of your customers. The buckets need to be have the same name in each plan. So that a task created in bucket "BUCK01", will be copied to the bucket "BUCK01" in the centralized plan.

So when do we start? New task has been created in the plan PLANNER 01. This will be a trigger for the Microsoft Flow. Let's go to Flow ... already we will have some exceptions in the Flow that will be explained in this blog.

Create a blank new Flow and add following trigger [When a new task is created], and select the source plan. Here PLANNER01.

Planner03.png

First some background to understand the following steps:

Buckets

You can sort the tasks into buckets to help break things up into phases, types of work, departments, or whatever makes the most sense for your plan.
The bucket has an unique bucket ID, see body output of the trigger:

 

Planner_Code01.png

The bucket id is for each plan unique. So the only way to match both buckets of each plan is the unique name “BUCK01”. So we need to have a mechanism to match the correct bucket name.

 

We can use the Flow action “List Bucket
Planner_Code02.png

In the bucket list, we can find both values. How do we match the first bucket value id towards the name of both plans and get the bucket id of the centralized plan. Therefore we create two variables (Type: string), one for the source bucket name and a variable for the destination (centralized plan) bucket ID.
Planner04.png

Rename the action to the appropriate description/name. Search for variable and select initialize variable.

Planner05.pngAdd two actions “List buckets”
Planner06.png
Search for action “List buckets”

Planner07.pngGetting the name of the unique bucket id from the trigger, can be done as follow. Compare the value of the bucket list of PLANNER01 with the body bucket id that can be found in the trigger output. Create a new action “Apply to each” and select an output of previous steps, equal to the value:

Planner08.png

Compare the bucket id’s, by adding a “Condition” – control “is equal to”

Planner09.pngPlanner10.pngPlanner11.pngIf it’s equal we will set the variable “ScrBucketNme” to the bucket name of the source plan bucket list.Planner12.pngPlanner13.png 
The opposite we will done, getting the bucket id of the centralized plan. Create a new action “Apply to each” and select an output of previous steps, equal to the value:
Planner14.png
Condition has been added to get the unique bucket id of the plan PLANNER02.
Planner15.pngPlanner16.pngPlanner17.png  

It’s equal.

Planner18.png

At this moment we have all the information to create a task in the centralized bucket “BUCK01”. But we need to solve still one problem. A task can be assigned to a person. But also the person has an unique ID. But this cannot be found in the standard dynamic content of the trigger “When a new task is created.”

Again the output of the trigger:

Planner_Code03.png

You can find the persons unique ID in the “assignments” of the JSON – output. Create an action to “Initialize variable”, here we a the following substring – expression.

Planner_Code04.png
We need to get the information of the string assignments” and id (2) and ac45b0b4-1a2b-46a6-b2d3-7c4a6f4dd458 (36)

substring(string(triggerBody()?['assignments']), 2, 36)

 

Planner20.png Do we have everything, Yes! We can create the task in the centralized plan in the correct bucket, equal to the source bucket name.

Planner21.png Complete overview of the flow:

Planner22.png 

This will result in the following output in Planner.

 Add Task in PLANNER01Add Task in PLANNER01Add Task in PLANNER01Task has been createdTask has been createdTask has been createdPLANNER02 is emptyPLANNER02 is emptyPLANNER02 is emptyFlow has been executedFlow has been executedFlow has been executedTask has been created in same bucket nameTask has been created in same bucket nameTask has been created in same bucket name
Enjoy! Feedback is welcome.
Would you like more of these Flow examples? Suggestions are welcome ...

Comments

*This post is locked for comments

  • frederikbisback Profile Picture frederikbisback 222
    Posted 28 Oct 2022 at 10:09:55
    Copy Planner task from one plan to another, towards the same bucket name

    Hello @Mark, Indeed is not possible with the action: https://learn.microsoft.com/en-us/connectors/planner/#create-a-task

     

    You can update the task description at https://learn.microsoft.com/en-us/connectors/planner/#update-task-details

    frederikbisback_0-1666951752356.png

     

    I hope this helps. 

     

     

  • Mark_Stokes Profile Picture Mark_Stokes 12
    Posted 28 Oct 2022 at 09:21:02
    Copy Planner task from one plan to another, towards the same bucket name

    Great article. 

     

    Only problem is that we don't seem to be able to add the Notes or Checklists with a task. Any way to do that?

     

    Mark

  • Community Power Platform Member Profile Picture Community Power Pla...
    Posted 20 Jul 2020 at 14:55:26
    Copy Planner task from one plan to another, towards the same bucket name

    This worked great for me! I'd like to use it to copy existing tasks as well - not triggered from "When a new task is created". However, when I switch it to be a manual trigger, I lose the bucketID in Dynamic content. Is there a way around that?

  • CrazyleX Profile Picture CrazyleX
    Posted 11 May 2020 at 19:44:35
    Copy Planner task from one plan to another, towards the same bucket name

    @sanaz 

     

    Hi!

    Thank you very much!

    Helped a lot!

    😃

     

    Frederik

    Thank you very much!

     

  • sanaz Profile Picture sanaz
    Posted 06 May 2020 at 21:08:19
    Copy Planner task from one plan to another, towards the same bucket name

    @CrazyleX 

    Hi,

    I did like this:

     

     
     
     

    Annotation 2020-05-07 000554.png

  • CrazyleX Profile Picture CrazyleX
    Posted 06 May 2020 at 18:36:32
    Copy Planner task from one plan to another, towards the same bucket name

    Sanaz,

    I have the same problem! =/

    How to do with more than one assignment ?

    I tried with two , but flow creates two new tasks...one for each assignment.

     

     

     

  • sanaz Profile Picture sanaz
    Posted 07 Mar 2019 at 06:55:01
    Copy Planner task from one plan to another, towards the same bucket name

    Hi,

    It was great thank you . just I have a question. how we can get more than one assignment?