Big Idea or Enduring Question:
How do you provide a way to clone a public group or queue with members to your users or system administrators?
In this article Clone a Chatter Group with Members, I had discussed a way through which you can provide a wizard to your users to clone Chatter group with members. This article will show you how you can provide a wizard to clone public group or queue with members to your users or system administrators.
I have written a few articles on automating Public Group or Queue and automation. Why not check them out while you are at it?!
- Getting Started with Salesforce Flow – Part 53 (Clone a User with their associated Public Group, Queue Membership, and Permission Sets)
- Getting Started with Process Builder – Part 19 (Automatically Add New User to Public Group or Queue)
- Getting Started with Process Builder – Part 56 (Auto Create a Public Group for new Account)
- Getting Started with Process Builder – Part 57 (Automatically add Partner user to Public Group)
- Getting Started with Salesforce Flow – Part 60 (Allow Anyone to Add or Remove User into Public Group or Queue)
This blog post will help us to understand the following
- Use a Screen a flow to take the user input to create a Public Group or Queue
- Learn how to work with the picklist component (Screen Flow)
- Learn how to use a Decision element to find whether a Record variable or a Record collection variable contains a record
- Learn how to associate queue with supported objects through Flow
- Find out how to use the Loop element to extract records from a record collection variable.
- And, last but not least, discover how to use the Create Records element to create multiple records (add a user to new public group or queue) at once (Bulk Safe)
Business Use Case
Brenda David is working as a System administrator at Universal Containers (UC). She has received a requirement from the management to create a wizard that allows a set of users to create a Public Group or Queue with members by cloning them quickly.
Automation Champion Approach (I-do):
- Lightning Web Component
- Apex Code
- Data Loader
- AppExchange App
We will use Salesforce Flow to solve it. Before proceeding ahead, you have to understand the Group object. Groups are sets of users. They can contain individual users, other groups, the users in a particular role or territory, or the users in a particular role or territory plus all the users below that role or territory in the hierarchy.
|Name||Name of the group.|
|Type||Type of the group. One of the following values:
Take a moment to understand GroupMember objects in Salesforce. It represents a User or Group that is a member of a public group.
|GroupId||The ID of the Group.|
|UserOrGroupId||The ID of the User or Group that is direct member of the group.|
Take a moment to understand QueueSobject objects in Salesforce. It represents the mapping between a queue Group and the sObject types associated with the queue, including custom objects.
|QueueId||The ID of the Queue.|
|SobjectType||A list of object types that can be associated with the queue specified by the QueueId.|
Before discussing the solution, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes going through the following Flow diagram and understand it.
Let’s begin building this automation process.