Getting Started with Process Builder – Part 92 (Streamline the Process of Auto Adding Chatter Group Members to Public Group!)

Getting Started with Process Builder – Part 92 (Streamline the Process of Auto Adding Chatter Group Members to Public Group!)

Last Updated on December 5, 2020 by Rakesh Gupta

public group comprises of many sets of users namely (1) general set of users; or (2) set of users within a territory; or (3) set of users within a specific role; or (4) subordinate users within a role hierarchy; or, (5) other groups.  Whereas Public Groups can be used for multiple purposes, Chatter Group is primarily geared towards boosting collaboration among users within an organization. Similar to a public group, a Chatter group comprises of a set of users too. Indeed, one can add unlimited users to a Chatter Group.

It is a daily job of a Salesforce Administrator to add users to public groups or chatter groups. In many organizations, it is a System Administrator’s responsibility to keep these groups in sync.

Let’s take a business use case to understand how a System Administrator can use automation to fulfill his/her aforementioned responsibility.

Business Use case

Donna Serdula has just been hired as a System administrator at Universal Containers (UC). She is an experienced Salesforce Administrator and is proficient at using automation to eliminate manual processes. Donna learnt that her colleague, Amy Collins, spends several hours per week adding users to a chatter group and then, adding the same users, to a public group:

Amy shares with Donna an example of the business process she follows to add Users to the Sales – EMEA Chatter Group and then to the Sales – EMEA Public Group:

  1. If a user is added to the Sales – EMEA chatter group.
  2. Then, the user must be added to Sales – EMEA public group. 

Amy mentions to Donna that achieving the above entails tons of manual work as UC has many Chatter and Public Groups and the same business process must be followed in all cases.

Donna assures Amy that she can automate the process going forward! Ah! What a relief! Amy thanks Donna and learns from her how to automate the process. Come along, join Donna and Amy on the journey!

A solution for the above business requirement

There are a few possible solutions for the above business scenariobut, we’ll use Flow and Process Builder to solve the above business requirementBefore trying to understand the technical aspect of the solution, let us spend some time to understand the general flow at a high level. Please spend a few minutes to go through the following flow diagram and understand it.

Screen Shot 2019-01-10 at 9.46.02 PM

Before we proceed further, let us understand the characteristics of 

Follow the instructions below to solve the above business requirement

1. First of all, create a Chatter group Sales – EMEA and a Public group Sales – EMEA.
2. Navigate to Setup (Gear Icon) | Setup | PLATFORM TOOLS | Process Automation | Flows.
3. Click on the New Flow button; it will open the Flow canvas for you. Create variable in the Flow, as shown in the following table:

Name Variable type Input/Output type
VarTUserId Text Input and Output

We will pass the value to {!VarTUserId} variable through Process Builder.

4. The next step is to add a user to the public group, as soon as s/he is added to the chatter group. For this, we will use the Get Records element to find the public group id and Create Records element to add a user to a public group. Now follow the steps as shown in the video:

–> Create Records element allow you to create a record in Salesforce using the values from the Flow. 
–> DeveloperName is the unique name of the public group in the API. 
–> If you want to create a Queue then, set Type value equals to Queue.

5. Use connectors to connect the elements used in the Flow. Finally, your Flow will look like the following screenshot:2019-01-10_22-41-16
6. Once done, Save the flow and name it Chatter group member to public group member, with Type: Autolaunched Flow. Do not forget to activate the Flow by clicking on the Activate button.

Launch a Flow from Process Builder

Our next task is to create a Process Builder on the CollaborationGroupMember object to start a Flow. To create a Process Builder on the CollaborationGroupMember object follow the instructions below:

  1. Navigate to Setup (Gear Icon) | Setup | Process Automation | Process Builder
  2. To create a new process from scratch, click on the New Button available on Process Management page. A popup will appear where you have to enter the Name (Use Automate group membership as the name)API Name and Description as shown in the screenshot below:Define Process Properties
  3. Once you are done, click on the Save button.
  4. Click on the Object node to add object and then select the GroupMember (API Name – CollaborationGroupMember) object. For the entry criteria, select only when a record is created, as shown in the screenshot below:Evaluation Criteria
  5. Once you are done, click on the Save button.
  6. The next task is to add Process Criteria, so that process will always fire whenever a Chatter group is created. To do this click on Add Criteria, enter Name and Type of action, follow the instructions below:Process Criteria
  7. Once you are done, click on the Save button.
  8. Now we have to add a Scheduled action (0 hrs after createdDate) ) into the Process to add users to newly created Chatter group. Click on Add Action (Under Immediate actions), Select the type of action (In our case Flows), and then fill the values into fields to define the action – as shown in the following screenshot:Add action – Flows
  9. Once you are done, click on the Save button. 
  10. In the end, your Process will look like the following screenshot:2019-01-10_22-53-49
  11. Do not forget to activate the Process by clicking on the Activate button.

Don’t forget to active the Process by clicking on the Activate button.

Next time, when a user is added to the Chatter Group (Sales EMEA) by the System Administrator, the process we created (Using Process Builder) will fire and, it will add the user to the Public Group (Sales EMEA).

Proofreader: - Munira Majmundar
Have feedback, suggestions for posts, or need more information about Salesforce online training offered by me? Say hello, and leave a message!

3 thoughts on “Getting Started with Process Builder – Part 92 (Streamline the Process of Auto Adding Chatter Group Members to Public Group!)

  1. Great article! One question: What is the reason to add the action in the Process Builder as a Scheduled Action (0 hrs after createdDate) as opposed to an Immediate Action? Does this trick something?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.