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
- 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.