How can you automatically post a message to the Chatter feed of related records?
Chatter is agreat way to boost collaboration in your organization.In this articleGetting Started with Process Builder – Part 13 (Auto Post a Message to Chatter When an Event is Created), I had discussed a use case, whenever an event is created for the public calendar post its detail to a Chatter Group using theProcess Builder. This article goes a step ahead and explains, how someone uses Flow and Process Builderto post to Chatter Feed of Related Record.
Objectives:
This blog post will help us to understand the following
Create a Process Builder and Flow to auto-post message to chatter feed of the related record
Understand how to use Flow to create a record
Business Use Case
Donna Serdula is working as a System administrator at Universal Containers (UC). She has received a requirement from the management to post opportunity details (with Opportunity link) to the related Account’s feed, whenever an opportunity gets created with an amount greater than $100k.
Automation Champion Approach (I-do):
There are a few possible solutions for the above business scenario. We will use Process Builder and Flow to solve it.
Let’s take a minute’s pause here and understandFeedItemobjects in Salesforce. It represents an entry in the feed, such as changes in a record feed, including text posts, link posts, and content posts.
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 2 steps to solve Donna’s business requirement using Process Builder and Flow. We must: Read the rest of this entry!
Posted at 4:00 PM by Rakesh Gupta, on March 24, 2015
Big Idea or Enduring Question:
How do you automatically Post a message to Chatter Group message when a user creates an event?
In Salesforce, Chatter Group represents the group of people. It’s a great way to boost collaboration in your organization. You can add unlimited members into a Chatter Group, but a user can only join a maximum of 100 Groups. In this articlePost Opportunity details to a Chatter Group, I had discussed how to post Opportunity closed information to a Chatter Group using the Flow. In the current article, we will discuss how to post a message to the Chatter Group using the Process Builder.
Objectives:
This blog post will help us to understand the following
How to use the post to chatter action in Process Builder
Auto-create a Post to Chatter when an Event is created
Business Use case
Brandon Schaefer is working as a System Administrator at Universal Containers (UC). His organization wants to post a message to the Chatter Group UC Internal Announcement, whenever an event is created for the public calendar Universal Container Conference Rooms.
Automation Champion Approach (I-do):
Public Calendars and resources are for managing group activities or shared resources. By using Public Calendars, a group of people can track events of interest to all of them (e.g., Sales events, weekly knowledge sharing sessions, or training classes) or schedule a common activity (e.g., a team vacation calendar). For example, with resource calendars, multiple people can coordinate their usage of a shared resource such as a conference room, etc. An organization can create an unlimited number of calendars.
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.
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 8 steps to solve Brandon’s business requirement using Process Builder. We must:
Create a chatter group
Create a public calendar
Find the public calendar Id
Creating a custom label to store public calendar Id
Define process properties
Define evaluation criteria
Define process criteria
Add action – post to chatter
Step 1: Create a Chatter Group
Navigate to App Launcherand click on the Groups.
Clicks on theNew button.
Name the Group and make sure to select the Private Access Type.
Click Save.
Step 2: Create a Public Calendar Universal Container Conference Rooms
Click Setup.
In the Quick Find box, type Public Calendars and Resources.
Clicks on theNew button.
Name the Calendar and make sure to select the Active checkbox.
Click Save.
Step 3: Find the Universal Container Conference Rooms public calendar Id
The next step is to find out the Id of the public calendar Universal Container Conference Rooms. One possible workaround is to use the Developer Console.
Click Setup | Developer Console
In the Query Editor, run the following SOQL query
Select id, name from Calendar where (name=’Universal Container Conference Rooms’)
Make sure to copy the Id.
Step 4: Creating a Custom Label
Click Setup.
In the User Interface, type Custom Labels.
Clicks on the New Custom Labelbutton.
Enter Short Description the Name will auto-populate.
Now enter the UC Conference Room ID in the Value.
Click Save.
Step 5: 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 6: Define Evaluation Criteria
Click on the Add Object node to begin selecting the evaluation criteria.
Select the Event object from the dropdown list.
Start the process only when a record is created.
Click Save.
Step 7: 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: User | Assigned to ID (Calendar) | Calendar ID
Operator: Equals
Type: Formula
Value: System Variable | Label | UC_Conference_Room_ID
Select All of the conditions are met (AND).
Click Save.
Step 8: Add Action – Post to Chatter
Below Immediate Actions, click Add Action.
For Action Type, select Post to Chatter.
Name the action.
Post to: Chatter Group
Group: UC International Announcement
Message:
An event is created for the public calendar “Universal Container Conference Rooms” click on the link below to learn more about it.
Almost there! Once everything looks good, click the Activate button.
Note:- Process Builder only allows you to post message type TextPost. If you want to post LinkPost or PollPost then, in that case, you have to use Flow and Process Builder.
Proof of Concept
Now onwards, if a user creates an event for the public calendar Universal Container Conference Rooms, then the Process Builder will automatically post a message in the Chatter groupUC Internal Announcement. It’s time to test out the process.
Create a new event on the Public calendarUniversal Container Conference Rooms
Click on the App Launcher.
In the Search Apps and items box, type Calendar and click it.
Add a new event by clicking a timeslot in the calendar.
For the Assigned To field, select Universal Container Conference Rooms.
Fill in the remaining details for the event like the screenshot below, then click Save.
Check out the Chatter Group, UC Internal Announcement. The following post will be automatically added to the group wall.
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.