How to Send Custom Notifications Using Salesforce Flow

As a system administrator in a company that uses Salesforce CRM to manage its sales data, I was working on a Flow automation.

For the requirement, I had to create a flow to send a notification to the Opportunity owner whenever the Opportunity Amount reaches or crosses the target amount, so that the sales user gets updates without checking every record manually.

In this article, we will learn about how to set up custom notifications in Salesforce and how to send a custom notification using Salesforce Flow.

Send Custom Notification Using Salesforce Flow

Below, I will explain how to set up custom notifications, and then we will create the flow to send a custom notification.

When the opportunity amount exceeds $10,000, the flow will be triggered, and the recipient (owner) will receive a notification.

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.

Set up Custom Notification in Salesforce

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

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

Send Notification using Salesforce Flow

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

Use flow to send custom notification in Salesforce

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

  • Enter the label for the notification in the Custom Notification Name field.
  • 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 a Custom Notification in Salesforce

Now, let’s create a flow to automate the process. Whenever an opportunity amount exceeds 10000, the notification should be sent to the opportunity owner.

Click on the Setup. -> Home Page. -> In the Quick Find Box, Search for Flows. You will see an option under Process Automation. -> Click on Flows.

In the flows setup window, click on the button New Flow -> Start From Scratch -> select the Record Trigger Flow -> Next.

In the start element, we have to select the object on which we want to perform automation. In our scenario, the Opportunity is a triggering object.

In the Configure Trigger, we need to select ‘A record is created or updated’.

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

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

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

Salesforce Flow Send Notification

Now we need to retrieve the custom notification that we created for this scenario. Select the Custom Notification Type object.

Then, to Filter Records for the object, we need to add a condition:

  1. In the Field option, you will see all fields from the Custom Notification Type. There, we need to select the Developer Name.
  2. Equals operator.
  3. In the Value, we need to select which notification we want to retrieve from the object (API Name).
Salesforce Flow Send Custom Notification

To send notifications to the opportunity owner first, we will store all owners’ IDs in the collection variable. This way, if the opportunity amount matches the defined condition, the notification will be sent to those owners.

To create the new variable, navigate to the Resource Manager and enter the details below to create the New Resource.

  • Select the resource type as Variable.
  • Enter the API Name for the resource, as it 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.
Use salesforce trigger flow to send notifications

Next, add the Assignment element to assign the opportunity owner IDs to the collection variable we created.

Now we have all owner IDs in the Owner_id collection variable.

How to Send Custom Notification Using Salesforce Flow

To notify the opportunity owners, add the Action element in the flow and search for the Send Custom Notification.

Send Custom Notification Action in Salesforce Flow

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 Title.
  • In the field Recipient IDs, select the custom variable you created in the Assignment element above.
  • In the Target ID, select the opportunity record ID.
  • At last, click the Done button.
Salesforce Flow Send Custom Notification Action Element

Now we are ready to save the flow. To do this, click the Save button, provide a flow Label, and the API Name will be automatically populated.

After that, always debug the flow before activating it to ensure that the working flow is correct and that there are no runtime errors. Then activate the flow.

Send Custom Notification Using Salesforce Flow

Proof of Concept

Now, navigate to the Opportunity object and create or open any existing record to update the Amount.

Next, update the amount according to our requirements to send a custom notification to the owner, and then click the Save button.

Send Custom Notification in Salesforce

As you save the record, you will get a notification on the bell icon on your Salesforce org.

Send Custom Notifications Using Salesforce Flow

In this way, we can set up and create the flow to send a custom notification using Salesforce flow.

Conclusion

I hope you have a hot idea about how to set up custom notifications in Salesforce and how to send a custom notification using Salesforce Flow. In this, I have explained how to use the send custom notification action element in Salesforce flow to automate the process of sending a notification.

You may like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.