Opportunity Example
Make Text Templates
A Text Template is a great way to prepare a formatted message, especially if we want to construct a piece of text using values from other resources such as Records and other variables.
- From Salesforce Setup, navigate to Flows using either Quick Find or Process Automation > Flows. Create or Edit a Flow.
- Open the Toolbox on the left-hand side of the screen, click New Resource.
- Resource Type: Text Template
- API Name: give it a descriptive name.
- Description: describe what the message will be when "assembled"
- Body: View as Plain Text, then assemble the message.
Read more about Markdown options available.
Add Action to Flow
Determine where in your Flow the Notification should be sent, and then add a new Element.
- Search for Teams to quickly narrow the list.
- Pick one of the 3 Teams Actions. For our example we will go with a Structured Notification.
- Label: Often best to specify who is getting the notification.
- API Name: Let it autofill
- Description: Tell your future self with a terrible memory why this notification is being sent
Configure the Message
The rest of the values are for the notification itself.
Populate them as needed. As a starting point, we've included some values below.
- Title: {!$Record.Name} - Opportunity Closed Won Alert
- Message: {!txtClosedWonMessage}
Facts aren't required, and you can populate any combination. They end up being displayed in a table within the notification. The first 3 are the first column of key-value pairs, with the last 3 being the second column.
Note: you can use Text Template variables anywhere here if things start getting crazy.
- Fact Title 1: Account Name
- Fact Value 1: {!$Record.Account.Name}
- Fact Title 2: Amount
- Fact Value 2: {!$Record.Amount}
- Fact Title 4: Commission
- Fact Value 4: {!$Record.Commission__c}
- Fact Title 5: Lead Source
- Fact Value 5: {!$Record.LeadSource}
Actions are Link Buttons that appear at the bottom of the notification, ideal for taking the user to records either within Salesforce or another platform.
- Action Label 1: View Opportunity
- Action URL 1: %%ORG_URL%%/{!$Record.Id}
- Action Label 2: View Account
- Action URL 2: %%ORG_URL%%/{!$Record.AccountId}
With everything populated, time to Save and Test!