Photo by Suzy Hazelwood

One of the features of Outlook is the ability to set up tasks with deadlines. It’s certainly not the most capable of task trackers, but serves well as a basic task tool. But the thing I’ve always found to be the most deficient is that it doesn’t actually remind you of deadlines that you set on those tasks. So you only know if a task deadline is approaching if you remember to go look on a regular basis. That’s something I’ve never been good at. Let’s take a look at how Power Automate can help. We’re going to set up a flow to create a daily email that will remind us of tasks, separating them into overdue tasks, tasks due today, and tasks due in the next week.

Please note that this only works with Office 365 Outlook accounts

Create the flow

We’ll start with a new scheduled flow. From the left menu in Power Automate, select Create, then select Scheduled flow as the type. We want our reminder email to arrive at the start of the day, so we’ll set the schedule to run at 7AM each morning. When it’s set up, it should look something like this.

Set up a daily schedule

Once our trigger is set, the next step is to retrieve our list of outstanding tasks in Outlook. Click “New step”, and in the search box type “Outlook”. One of the Action categories should say “Outlook tasks”. Select that option. If you have not previously connected tasks to Power Automate, you will be asked to sign in to create the connection. Once you do, you should see a list of actions related to Outlook tasks. Scroll down until you find the action named “List all tasks”. Don’t select the one with preview in the name

Find action named List all tasks

Now we’re going to need a variable store our email output in as we build it. Hover on the arrow between the Recurrence trigger and the List all tasks action. Click on the plus symbol that appears and click “Add an action”. In the search box type “Initialize variable” and select that action when it appears. Give the variable a name and select a type of string. In the default value, enter whatever text you want at the top of your email.

As a reminder, all Initialize variable actions must be at the top of your flow directly after your trigger. You cannot define variables later in the flow

Initialize email body variable

After this initialize variable step, we’ll need three more variables set up. The first is for overdue tasks, the second for today’s tasks, and the third is for tasks due in the coming week. These three variables will all be of type array. Set their initial values to an empty array [].

Initialize email body variable

Loop the tasks

Now that we’ve set up our variables, we’re ready to start iterating through the tasks and gathering out what we need for our email. Search for and select action “Apply to each”. In the “Select an output from previous steps” box, select the body object from the List all tasks step. This will create a loop to step through each of the items returned to us.

The first thing we need to do inside the loop is to make the data easier to work with. Since the API returns JSON to the flow, let’s add a step to make that data more workable. Inside the Apply to each box select “Add an action”. Search for and select the “Parse JSON” action.

In the action, add the following in the Schema box:

{
    "type": "object",
    "properties": {
        "@@odata.id": {
            "type": "string"
        },
        "@@odata.etag": {
            "type": "string"
        },
        "Id": {
            "type": "string"
        },
        "CreatedDateTime": {
            "type": "string"
        },
        "LastModifiedDateTime": {
            "type": "string"
        },
        "ChangeKey": {
            "type": "string"
        },
        "Categories": {
            "type": "array"
        },
        "AssignedTo": {
            "type": "string"
        },
        "HasAttachments": {
            "type": "boolean"
        },
        "Importance": {
            "type": "string"
        },
        "IsReminderOn": {
            "type": "boolean"
        },
        "Owner": {
            "type": "string"
        },
        "ParentFolderId": {
            "type": "string"
        },
        "Sensitivity": {
            "type": "string"
        },
        "Status": {
            "type": "string"
        },
        "Subject": {
            "type": "string"
        },
        "Body": {
            "type": "object",
            "properties": {
                "ContentType": {
                    "type": "string"
                },
                "Content": {
                    "type": "string"
                }
            }
        },
        "CompletedDateTime": {
            "type": "object",
            "properties": {
                "DateTime": {
                    "type": "string"
                },
                "TimeZone": {
                    "type": "string"
                }
            }
        },
        "DueDateTime": {
            "type": "object",
            "properties": {
                "DateTime": {
                    "type": "string"
                },
                "TimeZone": {
                    "type": "string"
                }
            }
        },
        "ReminderDateTime": {
            "type": "object",
            "properties": {
                "DateTime": {
                    "type": "string"
                },
                "TimeZone": {
                    "type": "string"
                }
            }
        },
        "StartDateTime": {
            "type": "object",
            "properties": {
                "DateTime": {
                    "type": "string"
                },
                "TimeZone": {
                    "type": "string"
                }
            }
        }
    }
}

In the Content box, click inside the box and select “Current item”. This will give us a more manageable dataset to work with.

First part of apply to each step

Next, we need to start looking at each item to determine what list it needs to be added to. After the Parse JSON step, add a Condition action. We’re going to add four of these Condition actions, stuffed inside each other. The first is to check whether or not the task is marked as completed. We don’t care about tasks already marked as done. The next three will be comparisons to the due date. This will tell us if it belongs in one of our categories.

Condition checks

And after all the conditions are added, it should look something like this:

All conditions added

All that remains is adding items to the email body and sending the email. For each of the three categories, we’ll add a header to the email body for that section, then loop the results of it’s array to add items to the list.

Build your email body

Once you’ve iterated each of the three category arrays and added them to the email, the very last thing to do is send the email. At the very bottom of the flow, add a send email step. Use whatever email process works for you. Put in your destination email(s), add a subject, and then in the body you’ll put the email body variable you’ve been building.

Send your email

Conclusion

And there you go. You’ve set up a daily reminder of your Outlook tasks.

About the author

Barret is a coder, gamer, father, husband, developer, manager, model railroader, writer, blogger, Browns fan, Buckeyes fan