September 25, 2021

Microsoft Planner: Send an email and create task

Let’s start with the obvious. There’s no feature in Microsoft Planner to send an email and create a task. But that doesn’t mean that it’s impossible.

I’ll show you how to do it with Power Automate, but I hope Microsoft renders this article deprecated as quickly as possible. This feature is amazing and supported by other apps (we don’t say the T name here), and it’s been asked a lot and for a while.

The Flow itself is not complex, but I want to define, as always, the strategy before since there’s a lot of ways to do this, depending on what you want to achieve or the tools that you have at your disposal.

Strategy

We need two things:

  1. A place to send the email
  2. A Flow that parses that email.

If you can, the best thing to do is to create a shared mailbox. Shared mailboxes are independent of your own, and they are handy for when you want to do actions like automation or notifications of systems. Of course, you need your administrator to create one, but there are many advantages to having one.

The second strategy is to use your own email address. It’s possible for you to email yourself and, with some tricks, you can have it so that the email doesn’t clutter your email box, either by removing it when parsed or archiving it.

Both strategies only differ with the start trigger. After that, all the rest will be the same, so that’s why I’m laying out both right from the start.

One last consideration. Regardless of the strategy, both will have emails that we don’t want to import. So we need a way to differentiate the emails that we want to import as tasks. Fortunately, a field will filter the emails based on the subject to insert something like “[task]” and trigger the Flow only for these emails. You can use other strings; the important thing is to have one that is fast to write and is unique enough so that other emails don’t get imported by accident. For this demo, let’s use “[task].”

The Flow

So let’s look at the Flow. Depending on your strategy you’ll need:

  1. “When a new email arrives” trigger – for your own mailbox.
  1. “When a new email arrives in a shared mailbox” – for when you have a shared mailbox that you can use.

Both have similar features, but we’ll look at the “Subject filter.” Since we only want to import emails that have “[task]” in the subject, we’ll need to use the “Subject Filter” field.

With the “Subject Filter” filled-in the Flow won’t trigger for all other emails. It’s a good idea to use this or other filter fields frequently, especially if you taught limits on how many Flows you can run

The Flow will trigger all emails containing this string in the subject, regardless of where it is. After this, we’ll do some cleanup to have a nice title to add.

The first compose action will contain a simple replace function.

replace(triggerOutputs()?['body/subject'],'[task]','')

We may have some empty spaces by removing the task, so let’s remove them using the trim function.

trim(outputs('Remove_the_[task]_string'))

Now that we have the subject let’s create the task using the Create a task action. It’s a bit scary, but here it is:

I’ve talked in the past about this, and I’m sure that Microsoft will improve this action. However, it’s not user-friendly, and there are other areas in Power Automate where similar fields are displayed differently.

Now you only need to send an email to yourself, and a task is added as a task.

Improvements

There’s more that we can do to improve this Flow. For example, we can use the body of the email as the description of the task. We only need to be careful because the body of the emails is HTML and not text, so we need to convert the text before we can add it. To do that, we need the “Html to text” action.

Finally, another consideration. To add the description, you need to use the “Update task details Action.”

I’ve sent another email with the body in bold to test if the conversion is correct, but as you can see below, Outlooks adds a lot of “stuff” to your email.

Let’s go to Microsoft Planner and see what we get:

Looking good.

Final thoughts

We can do more, but I wanted to keep this article simple and to the point. For example, we could parse the body to fetch any tasks and parse the email’s attachments as attachments to the task.

But my main point stands. With a simple Flow and your email, you can have features that don’t exist, for now, in Microsoft Planner.

Have a suggestion of your own or disagree with something I said? Leave a comment or interact on Twitter and be sure to check out other Microsoft Planner-related articles here.

Photo by Alesia Kazantceva on Unsplash

Manuel Gomes

I'm a Project Manager with experience in large projects and companies. I've worked in the past for companies like Bayer, Sybase (now SAP) and I'm currently working for Pestana Hotel Group.

View all posts by Manuel Gomes →

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: