cancel
Showing results for 
Search instead for 
Did you mean: 

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

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.

 Planner23.pngAdd Task in PLANNER01Add Task in PLANNER01Planner24.pngTask has been createdTask has been createdPlanner25.pngPLANNER02 is emptyPLANNER02 is emptyPlanner26.pngFlow has been executedFlow has been executedPlanner27.pngTask 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

Hi,

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

Meet Our Blog Authors
  • Working daily with Microsoft Cloud to deliver the needs of my company, my customers and various Microsoft communities and forums. | Office 365 | Flow | PowerShell | PowerApps | SharePoint |
  • Co-founder of https://plumsail.com, Office 365 and SharePoint expert. Passionate about design and development of easy to use, convenient and flexible products.
  • Microsoft Business Apps MVP. Owner of ThriveFast, an Office 365 consulting company.
  • 7x Microsoft Business Solutions MVP (CRM)
  • I'm keen in MS technologies, SharePoint, Office 365 and development for them
  • Daniel is a Business Productivity Consultant & Microsoft Business Solutions MVP who is very enthusiastic about all things Office 365, Microsoft Flow, PowerApps, Azure & SharePoint (Online). Since the preview, Daniel has been working with Microsoft Flow and later on with Microsoft PowerApps. That led to him being awarded an MVP Award for Business Solutions. He loves to blog, present and evangelize about improving productivity in the modern workspace with these amazing tools!
  • Michelle is an Office 365 solution architect in Twin Cities, MN. She has been delivering business collaboration solutions for years with her focus on SharePoint and Office 365. Michelle is a recent board member of the Minnesota Office 365 User Group and has been a member of the SharePoint community since 2009. She is a frequent speaker at MNSPUG and SharePoint Saturday and co-chaired the Legal SharePoint User Group for 4 years. Her most frequent projects have involved rolling out a large deployment of Office 365, SharePoint Online intranet, build of a "CHAMPS" Office 365 user adoption program and most recently, SharePoint On-Premise to Online Migration. Michelle is very excited about cloud technology as it is shifting her IT Pro focus to collaboration strategy and technical adoption.
  • I'm a Microsoft Office Servers and Services MVP with a special interest in SharePoint, Office 365, Microsoft Flow, Microsoft Teams and PowerApps. I work at Triad Group Plc ( https://triad.co.uk)
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor