How to Send Custom Notification using Flow in Salesforce

In Salesforce, custom notifications enhance communication amongst the org’s users by delivering personalized, real-time messages and alerts through app notifications. In this Salesforce tutorial, we will learn to send custom notifications using flow in Salesforce.

Send Custom Notification Using Flow in Salesforce

In this example, I will create a triggered flow that will send a notification to the opportunity owner when the opportunity amount is above 10000. When the amount is updated with more than 10000, the flow will be triggered and the recipient (owner) will get a notification of the same.

To send Custom Notifications in Salesforce using Flow, we will first set up the custom notifications that we need in the flow, and then we will create a record trigger flow that will send the notification to the user or the record owner.

Setup Custom Notification

To set up the custom notification, navigate to the Setup page and follow the below steps.

1. On the Setup page, go to the Quick Find box and search, then select Custom Notification Types.

Send Notification using Salesforce Flow

2. In the custom Notifications setup window, click on the New button.

Use flow to send custom notification in Salesforce

3. In the New Custom Notification Type window, enter the following details.

  • Enter the label for the notification in the field Custom Notification Name.
  • The API Name will be auto-filled according to the entered Notification name.
  • Activate the checkboxes Desktop and Mobile.
  • Click Save.
Send Notification in Salesforce using Flow

Create a flow to send Custom Notification in Salesforce

To Create a flow for sending Custom Notifications in Salesforce, navigate to the Setup page and follow the below steps.

See also  How to Add Record Type in Salesforce Flow

1. On the Setup page, go to the Quick Find box and search, then select Flows under the heading Process Automation.

2. In the Flows setup window, click on the click on the button New Flow.

3. Select the option Record Triggered Flow and Click Create.

4. In the trigger flow, select the Object. In this example, I have selected the object Opportunity.

Select the condition for the flow to trigger here. I have configured it to trigger the flow when the record is updated in the selected object.

Send Custom notifications using flow in Salesforce

5. Scroll down to the section Set Entry Conditions. Here, select the Condition Requirements as All Conditions are Met.

After this, select Field as Amount, Operator as Greater than, and enter the amount in the Value field.

Activate the radio button Only when a record is updated to meet the condition requirements.

At last, select the option for Optimize the flow as Action and Related Records.

Send Custom notifications in Salesforce using Flow

6. Add a Get Record element in the flow; this will fetch the ID of the custom notification.

Salesforce flows to send custom notification

7. Enter the Label and the API Name for the get record element. After this, select the object Custom Notification Type.

In the section Filter Custom Notification Type Records select the Condition requirements as All Conditions are Met.

In the condition, select the Field as DeveloperName, Operator as Equals, and Value as the API name of the custom notification that you have created in the above steps.

Send Custom notifications in Salesforce using trigger flow

8. Activate the radio buttons Only the first record and Automatically store all fields.

Create Trigger flow to send custom notification in Salesforce

9. Add an Assignment element to the flow below the get record element.

Send Notification to user using Flow in Salesforce

10. Enter the Label for the Assignment element, and the API Name will be auto-filled according to the entered label.

Send Notification using Salesforce trigger flow

11. To define the filter condition in this assignment, click on the Field and select New Resource.

Use trigger flow to send notification in Salesforce

12. Enter the below details to create the New Resource.

  • Select the resource type as Variable.
  • Enter the API Name for the resource since this resource will store the ID of the record owner to whom the notification will be sent. Therefore, I have entered the API name as Owner_id.
  • Select the Data type as Text.
  • Activate the checkbox Allow multiple Values.
  • At last, click Done.
See also  How to Create Platform Event-Triggered Flow in Salesforce
Use salesforce trigger flow to send notifications

13. After adding the variable, enter Operator as Add and Value as Record > Owner ID.

Use trigger flow to send custom notification in Salesforce

14. Now add an Action element to the flow.

Send Custom notifications using trigger flow in Salesforce

15. In the Action field, search and select the option Send Custom Notification. After this, enter the Label and API Name for the Action element.

16. In the section Set Input Values for the Selected Action, set the following values.

  • In the field Custom Notification Type ID, search and select Notification ID.
  • Enter the notification text in the Notification Body field.
  • Enter the title of the custom notification in the Notification field.
  • In the field Recipient IDs, select the custom variable you created in the Assignment element above.
  • At last, click the Done button.

17. Click on the Save button in the flow builder, then in the next window enter the Flow Label and Flow API Name and click the Save button.

Send custom notification using flow in Salesforce

18. To use this flow, we need to activate, and to do that, click on the Activate button.

Use trigger flow to send custom notifications in Salesforce

Till we have created and activated the flow, we will now check if it is working in further steps.

Test the created triggered flow

1. According to the applied conditions, I have updated Opportunity Amount greater than 10000.

Send Custom notifications to Record owner using Flow in Salesforce

2. After saving the update, the flow condition is triggered, and we get a notification regarding the update in the record.

Use record triggered flow to send notification in Salesforce

In this way, We can send Custom Notifications in Salesforce using Flow by following the above steps.

Conclusion

In Salesforce CRM, by using flows we can automate the custom notifications according to the business requirements. By automating notifications, users can be informed of new opportunities or critical issues, which results in enhanced communication in the org.

See also  How to Create and Deploy Scheduled-Trigger Flow in Salesforce

By following the above steps, you might have understood the process of sending Custom Notification in Salesforce using flow.

You may like to read: