Recurring tasks | During the fall of 2019, I attended TechDays Sweden as a Speaker alongside my colleague (and one of the founders of Altitude 365) Magnus Göransson. We had 2 sessions. One was a pre-day in the PowerPlatform and the other was a 1 hour session on every day digitalization using the PowerPlatform. In both, I showcased how you can make a simple recurring task creator using Planner, a SharePoint list and a flow in Power Automate. Figured I might as well publish it as a blog post as well to make sure everyone has a chance to copy with pride.
What are we building and why?
Every organization I’ve met have recurring tasks in some form. Some department doing something on a weekly basis, every manager will have their yearly evaluation with their employees and so on. (Now for the Managers, we’ve actually built another flow that will find the reporting user per manager and set up planner tasks for them, but that’s a different story for another blogpost).
In my example from TechDays, we simulated a company that opened new stores from time to time. Since we don’t know in advance when a Store will open, we’re going to trigger this Flow using a button but the same principles will apply if you want things created on a monthly basis for example. Just set the recurring trigger.
We’re building this to be our checklist in Planner for a new Store to track all the tasks. Sure we could have just listed all the tasks in an Excel file, but you don’t want to miss out on using Microsoft Teams as your Project collaboration platform now do you.
In this example, we’re building the flow to set up new stores in a consistent way. Feel free to apply this process to anything that suits you!
Setting things up
Few good stories begins without creating a Team and this is obviously no exception. This teams function is to be the collaboration hub for new stores, so we might use the file storage later on to store important templates and such. For now, we’ll focus on getting our hands on a plan in planner, so go ahead and create a Plan for your Team as well. You can name it New stores.
Next, head into the Teams SharePoint Team site and create a list. Create these columns in your list:
- Task Name
- Days from deadline
- Days in progress
The task name is of course for the name of the task. Pro tip: Create actionable task names. It’s better to have more tasks and be clear when a task is completed than having fewer and leave room for interpretation. If a task is to book meetings with 3 different persons, create 3 different tasks for it.
Bucket will represent the bucket in Planner in which the task will be placed. You must use the bucket ID, not it’s name here. See below for one way of getting this ID.
Assignee is where you’ll fill in the email address of the person who is to be assigned the task. Remember that they have to be a part of the Team where the Plan is. In our case, we’ll only fill in the name of the person who is always doing specific things. Let’s say there’s always one person who is onboarding the staff to our IT systems. Fill in that persons email address in the SharePoint list. There may perhaps be different people doing other things, like setting up the network. Leave this blank in those cases.
The days from deadline will be used to calculate the deadline of the task. We’re going to set the opening date when we trigger the flow. Let’s say that DNS needs to be in place at least 20 days before we open the new store. Simply put in the number 20 here.
Days in progress will be used to calculate the starting date for a tasks. It works like this; We’ll set an opening date in Flow and calculate backwards from that date to set the date from deadline. For example opening date is 20th of April 2020. We have 10 days from deadline for that tasks, so the due date will be set to 10th of April 2020. If we say that days in progress is 5, will have a start date on the 5th of April by subtracting the progress number of days from the due date.
Now head into Power Automate! Create a flow that will trigger when you push a button. Add the action “List Buckets” from Planner and choose your plan that you created before.
Trigger the flow and have a look at the running log. You’ll see the ID for each bucket here. We want this ID to store in our SharePoint list under the column Bucket, as we need to use ID and not names when working with dynamic content for creating our new task.
Create another flow. This is also triggered by a button but this time, we want to fill out some fields as we trigger the flow:
- Store name
- Opening date
- Network technician
Proceed to gather the items from your SharePoint list as seen below:
Next, we need an apply to each step, as we are going to create a task in Planner for each row in the list. Choose Apply to each and select Value from SharePoint.
For reasons unknown to me, I’m unable to use an expression later on with the dynamic value of the row content in SharePoint, so I’ve been using these 4 compose windows to create a value that is working as a dynamic value later on.
I basically just store the deadline number as well as the progress number first. After that, I create 2 expressions that will recalculate our numbers into negative ones. We filled in 20 before but, we want -20 as we are going to subtract the amount of days, not add them.
“Wait! Could we not just fill in -20 instead of 20 in SharePoint?”
Yes of course you can, but because of reason I prefer to not use negative numbers in my SharePoint lists and thus we must solve this like #PowerAddicts. Besides, where’s the learning in taking the easy way out?
Deadline dagar (in english; Deadline days):
Pågående dagar (In english; ongoing days):
Let’s head to the condition. It’s actually really simple. I just check whether the assignee field in SharePoint is filled out or not. If it is, we’ll use the name from the list. If not, we’ll go with whatever we filled in to the field “Network technician” as an input field for our button in Flow.
Now we hit the button and leap into action! With the simple click of a button you’ve created perhaps 100 recurring tasks that should always be preformed when setting up a new conference room, order a new service vehicle, set up an entire office, implement a new customer to your phone system or onboard one of your daughter companies into Microsoft Teams.
Speaking of Teams, this is obviously the next step for this. A planner is always attached to a Team, and thus I recommend you plan this by setting up the Planner as a tab in the Team meant to handle the tasks at hand. If the recurring tasks regards setting up new offices, name your Team accordingly. If you have another Team working on the yearly spring sales campaigns, set up a new Team for that with the proper members and simply copy the flow. Create a new SharePoint list with tasks and voilà!
If you set this up, please reach out and tell me of the awesome things your creating! Inspire me with your ideas on how this can be used and developed into something more. My twitter account is @Villezekeviking and my Teams address is email@example.com (backwards compatible if you’re using legacy systems like email).