Roland Oldengarm - Independent IT Contractor

Living in the coolest little capital Wellington, New Zealand!

How to: Send an email if a Salesforce opportunity is won using Microsoft Flow

After my blog post yesterday about Flow, I got a request from a user to build a Flow for Salesforce that does something when an Opportunity is closed, and checks if it was won or lost.

I love feedback, so I decided to build that flow. The result? Check out below email:

In the end it was not hard, the only tricky part is that the IsWon property is a boolean, and you need to go into Advanced Mode to convert that to a string first.

The Flow looks like this:

  • Trigger: An object is modified in Salesforce
  • Actions:
    • Get My Office 365 Profile
    • Condition: IsWon equals to True. You need to click Advanced Options to set the query, as the value must be converted to String.
    • Action if true: Send email

The only issue is, that Flow cannot detect the previous value. So, it will send an email every time a closed, won opportunity is updated. This can be mitigated by keeping track of emails sent: every time an email is sent, store that in e.g. a SharePoint list. If then the flow runs, it checks for an item in that list for the Salesforce Opportunity. If there is a record, ignore. Or do you know a better solution? If this issue is mitigated, I would be happy to submit the Flow to the Flow Gallery.

To see all the advanced logic options in a Flow, check out this article. You will need it when you want to create an advanced action or condition.


  1. Amit Lohogaonkar

    May 27, 2016 at 10:48 pm

    Thanks! Do you have an example of Odata filter to get opportunity or account based on current office 365 login user or any simple Odata filter

Leave a Reply

Your email address will not be published.