Big Idea or Enduring Question:
How do you auto-create a chatter group using Process Builder?
Objectives:
This blog post will help us to understand the following
- Understanding Quick actions
- How to use the quick action in Process Builder
Business Use case
Warren Mason is working as a System administrator at Universal Containers (UC). His organization wants to auto-create a private Chatter group, whenever an active campaign gets created. For Chatter group name they want to use the campaign name.
Automation Champion Approach (I-do):
Actions allow users to perform certain activities very quickly – such as create records, update records, send an Email, log calls, call a Lightning component, execute Lightning Flow, and call a Visualforce page. With custom actions, users save precious time by getting quick access to important information. It also has the capability to pre-populate the data from the record.
There are two types of actions available to users: object-specific and global.
- Object-Specific Actions:- These actions have automatic relationships to other records. The actions let users quickly create or update records, send an Email, log calls, call Lightning components, execute Lightning Flow, and call a Visualforce page in the context of a particular object.
- Global Actions – A System Administrator can create global actions in Setup. Then, s/he can put global actions anywhere on an object that supports actions. Using global actions, users can log calls, create records, send an email, call a Visualforce page, execute a Lightning component, and call Custom Canvas, all without leaving the page.
While this can be solved using various automation tools like Apex or Flow, we will use Process Builder. This is not something that can be accomplished with Workflow Rules. The benefits of using Global or Object-specific action with Process Builder over create a record or update records action are the following:
Before proceeding, ahead, understanding the below-listed salesforce objects:
Action | Create a Record or Update Records |
It allows you to set the Record Type without hard code the ID | Currently, you have to hard code the record ID |
It allows you to create Chatter Group or Notes | Currently, Process Builder doesn’t support Group, Note object |
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.
Guided Practice (We-do):
There are 4 steps to solve Warren’s business requirement using Process Builder. We must:
- Define process properties
- Define evaluation criteria
- Define process criteria
- Add action – quick actions
Step 1: Define Process Properties
- Click Setup.
- In the Quick Find box, type Process Builder.
- Select Process Builder, then click New.
- Name the Process and click the Tab button. The API Name will populate.
- As a best practice, always input a description.
- The process starts when A record changes.
- Click Save.
Step 2: Define Evaluation Criteria
- Click on the Add Object node to begin selecting the evaluation criteria.
- Select the Campaign object from the dropdown list.
- Start the process when a record is created or edited.
- Click Save.
Step 3: Define Process Criteria
- Click the Add Criteria node to begin defining the process criteria.
- Name the criteria.
- The criteria should execute actions when the conditions are met.
- Set Conditions
- Row 1
- Field: Campaign | IsActive
- Operator: Equals
- Type: Boolean
- Value: True
- Row 1
- Select All of the conditions are met (AND).
- Click Advanced.
- Select Yes to execute the actions only when specified changes are made to the record.
- Click Save.
The reason why we would select the Yes checkbox for the question — Do you want to execute the actions only when specified changes are made to the record? — is to allow the Process Builder to execute the actions only if the record meets the criteria now, but the values that the record had immediately before it was saved didn’t meet criteria. This means that these actions won’t be executed when irrelevant changes are made.
Step 4: Add Action – Quick Actions
- Below Immediate Actions, click Add Action.
- For Action Type, select Quick Actions.
- Name the action.
- Filter Search By: Global Actions
- Type: Create a Record
- Action: NewGroup
- Set Quick Action Field Values:
- Row 1:
- Field: Name
- Type: Field Reference
- Value: Campaign | Name
- Click Add Row
- Row 2:
- Field: Access Type
- Type: Picklist
- Value: Private
- Click Add Row
- Row 3:
- Field: Related Record ID
- Type: Field Reference
- Value: Campaign | ID
- Row 1:
- Click Save.
Almost there! Once everything looks good, click the Activate button.
Note:- Before you activate your process, you will want to make sure that you have assigned data in the correct format because Process Builder obeys validation rules. If some fields are required by using validation rules, then make sure you have added those fields. Conversely, if some fields are required on the page layout, you can ignore those fields.
Proof of Concept
Now onwards, if a business user creates a campaign and makes it active, then Process Builder will automatically trigger and create a Chatter group.
- Now create a new campaign (Demo Campaign 1), as shown in the following screenshot:
- Navigate back to the Groups tab and check the newly created chatter group.
Formative Assessment:
I want to hear from you!
What is one thing you learned from this post? How do you envision applying this new knowledge in the real world?
Let me know by Tweeting me at @automationchamp, or find me on LinkedIn.
Author: - Rakesh Gupta