Send Custom Bell Notification from Flow

Custom Notification Type: Custom notification type can be used to send the custom bell notification via a process builder, flow, Apex code, and Invocable action API. it is a very useful feature to notify the user of any changes/updates in the record.

In this post, I am going to share how we can create a flow to send the custom notification using flow in flow-builder. This flow will send the custom notification to the Account owner whenever the opportunity amount gets changed.

Advertisements

Create custom notification in your org.

Go to setup > search ‘custom notification’. Click on the new button and create a custom notification type.

Now, go to setup > in quick find search ‘flow’ and click on flow.

Click on the new button and select Record-Triggered Flow and click create.

Select Opportunity object and configure on which event this flow should execute, choose the “A record is updated” option. Set entry condition as Amount changed = TRUE.

Advertisements

Create a RecipientIDs collection variable to store the recipient’s ids.

Create a formula for a custom notification body.

Click on the (+) icon and select the ‘Assignment’ element. Add account owner ID in the Recipient IDs variable.

Advertisements

Click on the (+) icon and select the ‘Get Records’ element. Select the ‘Custom Notification Type’ object and add a filter condition ( DeveloperName = CustomNotificationTypeName)

Click on the (+) icon and select the ‘Action’ element. Search ‘custom notification’ in the action search box and select ‘Send Custom Notification’.

Fill in all the required fields (like shown in the screenshot below) and click on done.

The final flow will look like the below screenshot.

Click on save and activate the flow.

Test your awesome flow now. Update the amount field on any opportunity record. The account owner will receive the custom bell notification as you can see in the screenshot below.

Advertisements

Join 768 other followers
Advertisements
Advertisements

2 comments

  1. Hello sir,
    Thanks for this wonderful article.
    When implemented the same, I observed the user not getting notification in first go until he refresh his page and then it works like a charm. Is it a known behavior?
    Please confirm,
    Thanks in advance.

    Liked by 1 person

    • Hello Adil,

      It takes a few seconds to receive the notification; you do not need to reload the page; simply wait a few seconds for the notification to appear in the bell icon.
      This is normal behavior.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s