A few months back, I had written an article Automatically Add New User to Chatter Group to discuss a way through which we can auto add a new user to Chatter Group. To achieve it, I had used Flow, Process Builder and Workflow Rule. I got excellent feedback, so I wanted to share another way to do achieve the same business use case, using the Process Builder and Global Action. Let’s start with a business use case
Business Use case
Warren Mason is working as System administrator at Universal Containers (UC). His next assignment is to create a process to auto add a new user to Chatter Group (UC Internal Announcement).
Solution for the above business requirement
There are a few options for the above business scenario, but we’ll use Global Action (NewGroupMember) and Process Builder to solve the above business requirement. You can also use publisher action with process builder to create, update records or Log a Call purpose. Before proceeding ahead, you have to understand CollaborationGroupMember objects in Salesforce. It represents a member of a Chatter group.
Field Name | Details |
CollaborationGroupId | Represent Id of the Chatter Group |
MemberId | Represent Id of the user (Group member) |
Note: – It will only work in the org, which is upgraded to Summer’15.
Follow the below instructions to create a Process Builder to solve the above business requirement
1. First of all, create a Chatter Group (UC Internal Announcement)
2. The next step is to set up a process on the User object, to auto add a new user to Chatter group. Click on Name | Setup | App Setup | Create | Workflows & Approvals | Process Builder and click on the New button, Enter Name, API Name and then click on the Save button.
3. The next step is to add entry criteria. For this click on Add Object, select User object and for the entry criteria, Select only when a record is created, as shown in the below screenshot, once you are done click on the Save button
4. The next task is to add Process Criteria, To do this click on Add Criteria, enter Name, Type of action and set filter conditions (In this case set [User].IsActive Equals True) and click on the Save button, as shown in the following screenshot
5. The next task is to set the time for scheduled action. For this click on Set Schedule available under Scheduled actions. Set time for scheduled actions as shown in the following screenshot
6. Now we have to add a Time-based action into the Process to add the new user to Chatter group. For this select action type Quick Actions, Use Field Picker to select the field [User].Id and Text Entry field to enter Related Record ID, as shown in the following screenshot
7. Once you are done, click on the Save button, it will redirect you to Process canvas. Finally, the Process will look like the following screenshot
Don’t forget to active the Process by clicking on the Activate button.
Proof of concept
1. Now add a user via the UI
2. Once the user is created, they are automatically added to the group UC Internal Announcement within few seconds, as shown in the following screenshot
Note: – I will suggest, implement this first on your developer org, test it and then move it to production. Don’t try to implement this in Spring’15 org, otherwise, you will get an error.