One evening last week I wrote an important email to a client and I thought I sent it but I didn’t. I wanted to let the client know their project is ready so in the morning they can start using it. And after I finished writing that email, while checking for typos, I got distracted by something, and by another thing…and I never sent it that night.
It wasn’t until the next afternoon when the client finally reached out for an update when I realized my mistake.
Ouch, I just inadvertently added a whole day of delay, if only I had a way to notice that message that was left in the Drafts folder, after all, I never look at that folder, I am not of the habit of saving emails to be sent later, I usually write something and send it right away (after checking for typos).
I wondered if Outlook has a feature tucked away somewhere in the settings that can alert me when something like that happens, but a quick online search showed that there is none, but also showed that I am not the only one in this boat!
So I created a PowerAutomate flow to make sure this pesky scenario is less likely to happen again. This flow will monitor my Drafts folder in Outlook 365 and send me an alert when a message has been sitting in Drafts for a period of time that exceeds a certain threshold (I chose 60 minutes)
Here’s how you can recreate the same flow to fit your criteria: (skip to the end if you just want to use the same Flow I created and I’ll send you a copy)
Before we begin, create a message in Outlook and don’t send it, let it go to your Drafts folder (for testing later) If you’re using Outlook in a browser, you can switch to the Calendar view and back to emails to verify the message is in Drafts.
- Step 1: in PowerAutomate create a new Scheduled Cloud Flow, give your flow a name, and schedule it to run as frequently as you like, I want this check to run every hour


- Step 2: Add a New Step and choose Initialize Variable from the Variables category and call it CurrentTime, set its Type to Integer and its Value to 0


- Step 3: Repeat the same process to initialize a variable called MessageTime.
- Hint: You can click on the ellipsis (…) in the top right corner of each action block to rename that block, I like to include the variable names in each block to make the entire Flow easier to read later

- Step 4: Repeat the same process to initialize a variable called TimeDiffMinutes this variable will store the value of the time span in minutes representing how long each message has been sitting in the Drafts folder

- Step 5: Add a Set Variable action from the Variables category and set the CurrentTime variable’s value using the function utcNow represented in ticks, the syntax is:
ticks(
utcNow())


- Step 6: Add a Get emails (V3) action from the Office 365 Outlook connector and configure it to read the contents of the Drafts folder. Change “Fetch Only Unread Messages” to No and leave everything else as default.


- Step 7: Add an Apply To Each action from the Control category. Set its output to the “value” option from the Dynamic Content.


- Step 8: Add a Set Variable action and set the value of MessageTime to the following expression:
ticks(items('Apply_to_each')?['receivedDateTime'])
- Step 9: Add a Set Variable action and set the value of TimeDiffMinutes to
div ( sub( variables('CurrentTime'), variables('MessageTime') ), 600000000)
This expression will subtract the two timestamps (in ticks) then convert the result to minutes by dividing by 600 million (the number of ticks in a minute) Now we know how many minutes each message in the Drafts folder has been sitting there.- Here it is recommended to change the Concurrency of the Apply to Each loop by setting its parallelization to 1, this guarantees your variables are set correctly inside the loop.



- Step 10: Add a Condition block from the Control category and set it to TimeDiffMinutes is Greater to a number of minutes of your choosing. I like to set it to 60 minutes, that way, if an email sits in my Drafts for over an hour, I am notified.
- Step 11: In the “If Yes” section, add your preferred method of notification, I choose to get notified in the PowerAutomate mobile app AND via a Teams chat message, so I added a Notification action and a Teams Chat action with the message set to something like: The email “@{items(‘Apply_to_each’)?[‘subject’]}” has been sitting in Drafts for @{variables(‘TimeDiffMinutes’)} minutes!



- Step 12: Click Save, Test, Manually, Test and Run Flow ! If you don’t have a message in your Drafts folder, nothing should happen, but if you do have a message, you should receive an alert like this:


I hope this template helps you stay on top of your emails!
If you would like to be notified of new blog posts please sign up below.