 Hello everyone. I'm Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. In this video, I'm going to demonstrate a scenario based on record trigger flow. Let's understand the requirement of record trigger flow. So in this video, you will understand custom notification in flow. So in record trigger flow, if you want to send a custom notification, so how we can do that. So the requirement says whenever a case is escalated, then we need to send a custom notification to a public group. So we can send custom notification to an individual user as well as we can send that custom notification to a public group. So custom notification basically appears in this bell icon, right. And here it is mentioned like whenever case is escalated. So you might be thinking what do you mean by escalated. So if I jump to case object, and if I open any case record, so there you will see one field named as status. So if we added this field, so here you will find a pick list value that is escalated. So if on case record, if this status is changing and it is changed to escalated, then your flow should run. Okay, so I hope now you understood what is the meaning of escalation, then where we can see the custom notification. And now we need to just create a public group first, then I will be implementing the flow. So public group basically we create so that we can make more than one users member of a group. So here you just need to click on new. So I'm naming it as my group. And from here I am selecting users. So in my org I have to Salesforce license users so I'm just adding those and clicking on save. So here you can see my public group is created if I open this, so it will show me the members so both users are member of this public group. Now I need to send notification to this public group with the help of record trigger flow. So I'm going to create a record trigger flow now. Before creating record trigger flow I need to create one more thing that is custom notification. So first we need to create the custom notification here. Then you can use this that custom notification inside the record trigger flow. So here one demo notification is already available. So we can use this but if you want to create new one so you just need to provide the name and API name and supported channels right so I'm going to use this one. So I'm copying this API name so that I can use this in the record trigger flow. So here I am selecting object as case. If it is updated, then condition like status equals to escalated and from bottom I am selecting this option only when a record is updated to meet the condition requirement. So if you want to understand the difference between these two so you can read this help text. So perhaps you want the flow to run only when the triggering record is changed from not meeting the condition requirement to meeting the condition requirement when that's the case choose the second option. So only if like status is changing from any other status to escalated then only this flow will work. If I select second option in that case like whenever that record is updated and status is equals to escalated. So if you are not changing status field you are changing any other field and your status is escalated and if you select this option still your flow will run and we don't want to do that. We want to run the flow whenever the status field is changed from any other status to escalated and I'm selecting this actions and related record because we need to use that custom notification action. Now I clicked on plus. So here I'm selecting action and searching for notifications so here we have this option send custom notification. So before that here you can see like before implementing this action you need custom notification type ID. Right so I'm going to use that record first. So if you remember like this custom notification we need to fetch in the flow with the help of that we can only send custom notification. So you can search for custom notification type here you can search for developer name equals and this demo underscore notification which I created here. Then only the first record and automatically store all the fields so first you need to fetch this. Then again you can click on actions and search for notification sorry I selected wrong option. Second option I need to select. Then send notification. Right so here also like we need to create notification body notification title recipient IDs. Right so this recipient IDs will be the public group. So let's create these as well first then we will be having this option so I'm going to create notification body through new resource and having text template. So here I'm writing notification body and clicking on done. I'm creating one more text template as notification title. So I'm selecting viewers plain text and notification title right. Now, if I select this action again. So three things we have now custom notification ID we have we have notification body we have title. Now we need to populate recipient IDs. Right so here we need to provide a public group ID. So I need to query that as well. So I'm selecting get record so get group. So public groups are available under this group object so you need to select group and here you can search it so. I'm just having public group name so let me search public group. So we have both the things name or developer name. So here we have public group name so it is a developer name. So I'm just copying this developer name equals this my group. So this group is fast only the first record automatically store all the fields. And now I can finally have that action. So here you need to provide the ID so we have notification like this custom notification type from get notification. So you can just select the ID. And here you can have notification body here you have notification title and here we have this group dot. Okay, we just need to provide the group. Okay, this we need to check so basically. I'm just taking help from Salesforce article so we have this help. So here you can see, like in recipients ID, we need to provide group ID so the notification is sent to all active users who are a member of this group. So the ID of recipient recipient type. Okay, so basically what we need to do, it is a collection variable and we need to put that public group ID into a collection then only it will work. So I'm just canceling it. And here I'm going to create a collection first. So recipient IDs text, now multiple values and so I'm just having assignment here. So that public group that we fetched through get record that's ID will be added into this and let's say if you want to add some individual user as well so you can add that user ID to this recipient ID. So what you can do you can select this recipient ID, then add and here you can have that particular ID. Okay, but right now we have this public group so I'm adding that. Now, again clicking on this action and selecting send custom notification action. Now everything will be available so let's have this first, then we have title, then we have body, then we have notification type.id, right, and then click on that. So this way our flow is created. Now I'm just clicking on save so send some notification clicking on save and activating it. Now if I go to the UI and let's say I'm just sending the status of this case, and I'm clicking on save. Okay, so there is some error. So we need to provide some more information so let's read the complete error message. So whenever there is some failure so Salesforce automatically send you the email. So it is failing because you can't send a custom notification without a navigation target. So either a target ID or target page reference. So basically, if I go here, open this notification so we need to provide this target ID. So target ID will be the report. So I am just having the case ID. So we need to populate the ID through which that custom notification should be sent. Right. So in our case whenever we update any case so that case ID will be available in this target ID. Clicking on done save as. So this way I hope you understood like whenever flow fails so you receive an email and basis on that email you can just fix your bug that is available in the flow. Now if I click on save. So it is saved. And so here you can see we have a notification here, a few seconds ago. Notification title notification body. So this week created as a dummy if you want to have some other data so that will be available here. So right now I'm logged in as this user with Sanjay Gupta so in this user's notification bell that notification is available. Now I'm going to log in with my another user and I will show you. I'm going to log in with the second user which is available here and if you want to have that login button automatically so what you can do you can just search for login access policies, then enable the checkbox and save it. Now if you search for users. So I will be able to log in with the user other than the login user so that you don't need to remember the password so I'm just clicking on login. So I will be logged in with that user. And here you can see in that user's notification value. One notification is available. A few minutes ago. Right. So this way, if you want to send custom notification to a public group, so that you can do. And for that, you just need to follow all the steps that I demonstrated in this video. So I hope you understood how we can send a custom notification through report trigger flow, whenever a case is escalated to a public group.