Two Ways to Post to Chatter Using Salesforce Flow

In Salesforce, we can automate the flow for posting anything on chatter to update information to the group when any operation happens in Salesforce Org.

In this Salesforce article, we will see how to post to chatter using Salesforce flow in two Ways. We will also see what chatter is in Salesforce and how to post to chatter using Salesforce flow with a scenario and explanation.

What is Chatter in Salesforce

In Salesforce, chatter is a social collaboration application that lets employees, clients, and others talk to each other, share information, and work together. We can create a group for a team to share work-related files and information. Share information through the group feed.

Two Ways to post to chatter using Salesforce Flow:

  • Using Standard Action(Post to Chatter):
  • Using Create Records Element:

Let’s consider a scenario to understand better. Whenever the Account Name is changed or updated in the Standard Account object, we need to create a message and post that message automatically to a chatter group.

Pre-requisite: We need a group; here, I have created a chatter group with an Account Group name.

You can read the whole article on How to Create a Chatter Group in Salesforce.

To post a message on the chatter automatically, we need to create a record-trigger flow with action, and like this, we can post to the chatter using Salesforce Flow.

How to Post to Chatter Using Standard Action in Salesforce Flow

Using the above scenario and the following steps, we can post to chatter using flow in Salesforce.

Create Record-Trigger Flow:

1. Log in to Salesforce Org. -> Click on the Setup -> Home Tab -> In Quick Find Box, Search for Flows. You will see an option under Process Automation -> Click on Flows.

Then, click on the New Flow button to create a new flow.

2. Here, when the record gets updated, a message should be posted to the chatter. For that, create a flow with a Record Trigger Flow.

Now, we will create the following elements in the flow according to the flow diagram displayed in the following Flow Diagram.

Post to Chatter in Salesforce Flow

1. Record-Trigger Flow:

3. In our scenario, the flow should trigger when we update an Account record. That’s why I have selected the Account in the Object field. In Configure Trigger, I have selected A Record is Updated because when we update the record, the flow should trigger.

Create Post to Chatter Using Salesforce Flow

4. Then, we have to Set Entry Conditions, and in the Condition Requirement option, we have to select All Conditions Are Met(AND) because the following condition should meet the criteria.

See also  How to Add Record Type in Salesforce Flow

The triggering condition is, if Account_Name – Is Changed – True, then only this flow will be triggered.

Create Post to Chatter Using Flow in Salesforce

5. Then we need to select Every time a record is updated and meets the condition requirements: When you select this option, every time you update the record, the flow will trigger.

We are going to create a chatter post into a collaboration group, so we have to select Optimize the Flow for Action and Related Records.

2. Get Records(Account Group):

6. Here, we need to use the Get Records element to get the ID of the group we created in the group object. Then, enter the Label. I have entered Account Group, and the API Name will automatically populate.

In the Object field, we have to select Group because we want to fetch group IDs. As you click on the object field, you will see two groups. There, we have to select the GroupCollaboration object.

7. Now, in the Filter Group Criteria, we need to add a condition; in the Field option, we can select the Group object’s fields. There, we need to select the Name field, which equals the Group Name that we created.

I have entered Account Group as a group name. Then, do not change anything and click on the Done button.

How to Create Post to Chatter Using Salesforce Flow

3. Action(Post to Account Team):

8. Now, we want to post a message to the chatter group, so we need to add an Action Element. To add an action element, click on the + plus icon, and then you will see the Action Element. Then click on the All category.

As you click on it, you need to add Action in the Action field. To create a task, we have to select the Post to Chatter action. Then, enter the Label, and the API Name will automatically populate. The description is optional; you can give a short intro about this Action element.

Post to Chatter Using Salesforce Flow

9. Then, we need to create a Message that we want to post in the chatter group after the account name is updated. To create a message body, click on New Resource. -> Select Resource Type “Text Template“. -> Enter API Name, here I have entered Message. -> Enter the Message that you want to send in the Body.

See also  Create Record Trigger Flow in Salesforce | What is Record Trigger Flow in Salesforce

Using Resource Picker, you can access the Account fields API name, which will display after the message is posted to chatter. Here, the Prior_Name will display before changing the name, and others will display after changing the name.

Then click on the Done button.

How to Post to Chatter Using Salesforce Flow

10. Now, we need to Set Input values for the Selected Action. Here, we have to assign values to the chatter object.

  • Message: In this field, select the Message Body, which we created in New Resource.
  • Target Name or ID: We can add either the group’s name or its ID here. I have entered the Group ID.
  • Target Type: We want to send this chatter post to the group, so our target type will be Group.

Click on Done.

Create Post to Chatter Flow in Salesforce

4. Save:

11. Then, click the Save button to save the flow. For that, we need to enter the Flow Label; here, I have entered Post to Chatter using the Salesforce Flow.

The API Name will automatically populate as we click the text box. The Description is optional; we can introduce our flow Shortly.

How to Create Post to Chatter in Salesforce Flow

5. Debug & Activate:

12. After setting up all labels and conditions, first save the flow. You can see the Save button. Click on it and then click on the Debug button.

Then click on the Activate button; always remember to debug the flow before activating it. It’s good practice to use flow.

Post to Chatter in Salesforce Flow

13. After Activating the flow, let’s check how it is working; for that, go to the Account object and select an account record.

Here, you can see the first and second images. I have changed the account name and Saved the record.

Post to Chatter in Salesforce Flows

14. Now, we will see if any posts have been created or not in the Account Group chatter group that we have created.

To navigate to the chatter group, click on the App Launcher. -> Search Chatter in the search box. -> Under the Item option, you will see the Chatter option. Click on it.

How to Post to Chatter Using Salesforce Flows

15. As we click on the Chatter, you will see the Post has been successfully uploaded to the chatter to the Account Group and the message with the Old and New Account Name.

Create Post to Chatter Flows in Salesforce

This is how we can create a flow for how to post to chatter using Action Element(Post to Chatter) in Salesforce Flow.

See also  How to Create a Case Related to an Account using Flow in Salesforce

How to Post to Chatter Using Create Records Element in Salesforce Flow

Here, I will use the same flow for creating the flow to post to chatter using the create record element.

1. To create the flow to post to chatter using the Create Record Element, you can follow the same steps, only you don’t need to create an Action Element where we add Post to Chatter Action.

2. Instead of adding an Action Element, add the Create Record Element. Enter the following details:

  • Use separate resources and literal values: We need a few fields here, so I have selected this option.
  • Object: In the object field, we need to fetch fields of group objects, but since we are creating a post using the Create Record Element, we have the Feed Item option here.

Now, we need to assign values to the Feed object field.

  • To the Body field, we have created a Message resource; select Message resource.
  • The ParentID is like where we want to post this message. So here, I have selected GroupID.

Then click on the Done button.

How to Post to Chatter Using Create Record Element in Salesforce Flow

3. Here, you can see we have only removed the Action Element and created a Create Records Element. After that, Save the flow and then Debug and Activate the Flow.

Post to Chatter Using Salesforce Flows

4. After Activating the flow, let’s check how it is working; for that, go to the Account object and select an account record.

Here, you can see the first and second images. I have changed the account name and Saved the record.

Create Post to the Chatter Flows in Salesforce

5. Here, you can see in the Chatter Object that the Post has been successfully uploaded to the chatter to the Account Group and the message with the Old and New Account Name.

Post to chatter using Create Record Element in Salesforce Flow

This is how we can create a flow for posting to chatter using the Create Records Element in Salesforce Flow.

Conclusion

I hope you have an idea about posting to chatter using Salesforce Flow. We have seen what chatter is in Salesforce and also how to post to chatter using Action Element and Create Record Element in Salesforce Flow with a real-time scenario and step-by-step explanation.

You may like to read: