Big Idea or Enduring Question:
How can we use Salesforce Flow to allow anyone to Add or Remove Users from Public Groups or Queues?
In Salesforce, Queues and Public Groups represent a group of users. Only administrators and delegated administrators can create and edit public groups. At the same time, anyone can create and edit their own personal groups. Some of the common question people asked me often are following:
- How do we provide an ability to our users so that they can add or remove themself from a Public Group or Queue?
- Is there a way to make business users delegated Administrator (When we are not using Role) to add or remove anyone into Public Group or Queue?
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)
After reading this article, you will be able to:
- Learn about the Group and GroupMember object and how it relates to Public Groups and Queues
- Create a Screen Flow that will allow users to add or remove users from Public Groups and Queues
- Understand the component visibility option to create a highly dynamic screen
- Use formula to better manage your flow
- And, last but not the least, discover how to add a Flow to Lightning Record Page and display it to a set of users using Custom Permission
Business Use Case
Elise Shelley, a Lead System Administrator at Universal Containers (UC), receives a requirement from his management. They want to develop an application that allows a set of users to add or remove anyone from public groups or queues.
Automation Champion Approach (I-do):
While this can be solved using various automation tools like Apex, etc, we will use Screen Flow to solve it without using a single line of code.
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.|
Before discussing the solution, let me show you a diagram of a Process Flow at a high level. Please spend a few minutes to go through the following Flow diagram and understand it.
Let’s begin building this automation process.