As we know, Flow is the future of automation tools. Flow is known for its feature of automating information with ease. Keeping all these features in mind, I will share how I automated a requirement of sending emails to queue members via flow.
I will be using a Record Triggered Flow on the Case object. It gets fired on create/update. I will help you learn step by step how we achieved this. I will also tell you how to test this flow at the end.
Let’s get started with how the flow will look come up at the end in free form.
To see how the flow should look in auto-layout Click-here.
I have used multiple elements to achieve the result in auto-layout. Let’s understand and create the flow together. You will have to make a queue and add numerous users before we proceed. Refer here. All the flow elements and resource images are in this zip file.
Step 1: Start the configuration by choosing the Case object and flow trigger as A record is created or updated in Start Element. Don’t add any entry conditions for this flow. Choose Actions and Related Records as email is an after-saving action.
Step 2: Add Get Records Element and name it Get Queue Id. Select Group from Object where Name equals {!$Record.Owner: Group. Name}. Refer images below:
Step 3: Add a Decision Element and name it Validate the Case Owner. Name the first outcome Case assigned to Queue. You will need to add one condition to check for an empty queue. Enter {!Get_Queue_Id} in Resource where Is Null should be False. {!Get_Queue_Id} is the element you created in Step2.
Step 4: If Get Queue Id is not null then, add the Get Records element and name it Get User Ids. It will get users' Id from Group Member Object where GroupId equals {!Get_Queue_Id.Id}. Create a new resource UserIds of Record Data Type, Group Member Object, and check to Allow multiple values (collection) checkbox. Enter the other details as shown or chosen in the images below:
Step 5: AddLoop element and name it Loop over User Ids where details are to be filled as given in the image below: Collection Variable as {!UserIds}
Step 6: Add Get Records element and name it Get Email Id from User where Id equals {!Loop_over_User_Ids.UserOrGroupId} i.e; each item from UsersIds then get User Email.
Refer to the image below:
Step 7: Add the Assignment element and name it Assign Emails. Create a new resource AllEmailIds of Text Data Type and check to Allow multiple values (collection) checkbox. Enter the other details as shown or chosen in the images below:
Step 8: Add the Action element and name it Send Email to Queue Members. Create a Text Template as EmailBody and body as Case: {!$Record.CaseNumber} has been assigned to {!$Record.Owner: Group.Name} queue. Lastly, connect it to Stop. Enter the other details as shown or chosen in the images below:
In the end, add your user to the queue you have made earlier and create a case. You must receive an email after the case is created successfully.
Happy!! To help you add to your knowledge. You can leave a comment to help me understand how the blog helped you. If you need further assistance, please leave a comment or contact us. You can click on "Reach us" on the website and share the issue with me.
Blog Credit:
Z. G. Mir
D. Khare
Salesforce Developer
Avenoir Technologies Pvt. Ltd.
Reach us: team@avenoir.ai