There’s nothing worse than archiving/organizing email. That’s where productivity goes to die a horrible death. But with the number of emails that we all get, we can dump everything into a folder or try some organization to save time. None is ideal, and all of them are time-consuming. The former you spend time searching, and the second you spend time organizing. Power Automate helps a lot with the “Move Email” Action. With it, you can monitor your mailbox (or a shared mailbox) and, based on criteria, move the emails to the proper folders. You can think of things like:
- Every email that contains “unsubscribe” is moved to a separate folder called “newsletters.”
- Every email that you’re in CC goes to the “read later” folder.
- If an email arrives from someone (or service, for example), move it to the “notifications” folder.
The idea is to keep your mailbox as lean as possible. The same goes for shared mailboxes. I would argue that they are essential because they are busier and managed by multiple people. Having a system that deals with email always the same way is a great way to keep things organized. I wrote an article on how to move emails in shared mailboxes to check it out if you want more details.
Where to find it?
You can find it in “Standard” under “Office 365 Outlook”.
Within Outlook there’s a lot of actions so it’s best to search:
Power Automate tends to save the most common actions in the main screen, so check there before going trough the full hierarchy. Also you can use the search to quickly find it.
Here’s how it looks like:
Microsoft did a great job simplifying a super complex action, but let’s look at the fields individually because there are some caveats that you should be aware of.
The message ID is something that you need to fetch from somewhere. It’s not something deterministic that you can calculate, so it’s usual provider by another action or trigger. For example, if you have the trigger, “When a new email arrives,” you’ll automatically get the ID of the email that you can use in the move. This goes for any action that fetches emails, like “Get Emails.”
The “Move Email” action won’t be able to move your email without this, and it will fail you can’t find an email with that ID.
Another important note is that the ID is independent of where the email is. You don’t have a different ID if the email is moved from the inbox to another folder, for example, so you can consider that the ID follows the email in your mailbox.
The folder is the destination where the “Move Email” action will move the email. It’s important to know that this displays folders if the “Original Mailbox Address” is:
- Empty or with your email, it will display your folders.
- With a shared mailboxes email, it will display its folders and not yours.
You can add a dynamic path but be careful of:
- Special characters
- Long paths
Any of them a world of pain of you get them wrong. I strongly recommend that you don’t use dynamic paths. Define your folder so that your action is as deterministic as possible.
Original Mailbox Address
Unless you want to access another mailbox, you don’t need to fill in this field. The default folder list will always be yours. This field is here to define shared mailboxes, for example, and have access to the list of folders that it contains.
You need to have permission to access a shared mailbox before you can move the email. You won’t configure any permission in the “Move Email” action, so you need to ensure that the permissions are correct. A good rule is if you can see the shared mailbox in your desktop version of outlook, then you have permissions. This is not a limitation but is something that generates some issues when trying to use the action.
Here are some things to keep in mind.
Use it wisely
Having emails being moved automatically can be good, but if you’re not checking the folders where the emails are being moved, you may miss some emails. Also, please remember that this action is permanent and without any notification. You can build one in your Flow, but be careful.
Always add a comment.
Always indicate in the action what its intention. It’s important to fill it before you start adding the parameters to know what you want to do. After a while, when you’re debugging something, you can then check if the comment matches what’s really happening.
Avoid dynamic paths
Suppose you can always define the folder that you want to move the file. You’ll save yourself some headaches in debugging if the Flow, for some reason, doesn’t accept the folder. Don’t forget that your folder may contain special characters, so having the folder defined prevents you from dealing with situations like that.
Be careful with the destination.
The destination folder that you’re moving the email may not be in the same mailbox. If you’re getting emails from your mailbox and move it to a shared mailbox, you will move the email. This is possible but only do it if you’re sure that it’s the right thing to do. Multiple people read shared mailboxes, and having an email there that was not addressed to that mailbox can be confusing.
Flag somehow the folder.
It’s not mandatory but a good way to avoid issues. The folders can be renamed, moved, or deleted. Your Flow will fail in all of these cases, so, if you can, define in the name something that signals that the folder is being used in a Flow. Choose what’s right for you and your team, but make it apparent. There’s always the temptation to look at a folder and think. “What’s this doing here?” Plan for mistakes because they will happen.
To add more to the issue above, please check for errors. I provide a tutorial on how to deal with errors, so don’t let your Flow fail. Catch the errors, notify people that something went wrong, and fail graciously. Some “errors” may be expected or even “normal,” so having Flows that fail in these situations is bad. You’ll never know if a Flow is failing because of an error or because an exceptional case occurred.
Back to the Power Automate Action Reference.
Photo by Phil Desforges on Unsplash