Tip #1215: Automatically manage folder tracking

Public service announcement: we are back from the Merry Year hiatus and straight to tipping.

Tracking folders is a cool feature where you can configure an Exchange folder to be a tracked folder and optionally link it to a Dynamics 365 record so that any email landing in that folder will be automatically tracked and Regarding will be set to that record.

This is great if I want to follow specific records, for example, a large opportunity.


Create a subfolder in the Inbox


Open Personal Options > Email tab > Configure Folders Tracking Rules


So now I would shove any correspondence that may be related into that folder and let the system do the work.

This is all nice and emails are, indeed, tracked. But what happens when the opportunity is closed? Well, nothing. Wouldn’t it be nice if we can “untrack” the folder? If for nothing else then for the 25 tracked folders limit – I want to have some space for the new opportunities (and no, I didn’t win the one above).

Enter Flow. Why not workflow? Because Flow has two distinctive advantages:

  1. It can actually delete records
  2. It can access tracking folders configuration records  – Mailbox Auto Tracking Folders (mailboxtrackingfolders) entity

The flow logic is as following. Just one screenshot, people, as it fits on one screen!


  1. Trigger on when opportunity record Updated, filter on statecode. Technically, should add an extra step validating that opportunity has been indeed closed.
  2. Get all mailbox tracking folders where Regarding is equal to that opportunity. Folder tracking is a per-user feature so multiple users can be tracking the same opportunity.
  3. Loop through returned records and nuke them.

Tested and tracked folder is as good as gone!

Wouldn’t it be nice if we could also create tracking folder configuration if certain conditions are met, like opportunity value > $1,000,000? Unfortunately, configuring tracking folder requires knowledge of Exchange folder id and I’m yet to figure out how to find that easily. Drop me a line if you figured that out!

(Cover photo by Omid Kashmari on Unsplash)

Leave a Reply

Your email address will not be published. Required fields are marked *