# How to Create Chatter Notifications from Inbound Messages

> \[!NOTE]
>
> Before you start, be sure that you've completed the following requirements:
>
> * Complete the instructions outlined in the previous help guide: [Receive Incoming Messages in Salesforce](/docs/salesforce/install#5-create-a-webhook-for-your-messaging-service).
> * Create a Chatter group that you can post messages to. If you are unsure about how to do this, check out the Salesforce documentation on [how to set up a Chatter group](https://help.salesforce.com/articleView?id=collab_group_creating.htm\&type=5).

In this section of the guide, you'll learn how to create a Salesforce Chatter notification when you receive an inbound message.

## 1. Create a new Process Builder flow

In your Salesforce setup home page, go to the left-hand navbar and click on **Process Automation > Process Builder** :

![Salesforce setup page with Process Builder highlighted under Process Automation.](https://docs-resources.prod.twilio.com/28fe3c546ddb7635fa1d5012cf4ce7c30290160626a35efdf6c523a44a85589b.png)

On the **My processes** page, click the **New** button at the top right corner:

![Salesforce process builder for posting Twilio SMS to Chatter group with message field details.](https://docs-resources.prod.twilio.com/9a05000426a070a8dd1dc5e8f5d61835b06ec3800e885388692c513677af3546.png)

In the **New Process** panel, enter the following information:

* **Process Name** — `SMS Chatter Notification`, or a custom name.
* **API Name** — `SMS_Chatter_Notification`. Press Tab to auto-populate this field.
* **Description** — `Creates a Chatter notification on inbound SMS.` This is optional.
* **The process starts when** — Select **A record changes** .

![Form for creating SMS Chatter notifications with Twilio in Salesforce.](https://docs-resources.prod.twilio.com/d78c53d1286ceb7b35338bdfb434d8b08a2f36afb9a259a6ab694ba4935228dd.png)

## 2. Set up the Process Trigger

Now that you've created your Process Builder flow, you can configure it to create the Chatter notification.

Start by clicking on **Add Object** . Enter `Twilio` in the **Object** finder and select **Twilio Message**   as the object to trigger on:

![Salesforce process builder showing object selection for Twilio message trigger.](https://docs-resources.prod.twilio.com/8183de4581eff5bf8af0526b6561cdeddbd465e6479dc63e710121a7e9092844.png)

Then, under **Start the process** , make sure that you've checked **only when a record is created** :

![Select 'only when a record is created' for Twilio Message process start.](https://docs-resources.prod.twilio.com/d23412fe67a86ff09e1b9e9517c56623453899b2aa16c086cb1adc1fa00fb810.png)

## 3. Define the process criteria

Now that you have your trigger set up, you need to configure the process so it only creates Chatter events when inbound messages are created.

In the diamond underneath the **Twilio Message** trigger, click on **Add criteria** . You'll see a side panel headed **Define Criteria for this Action Group**   appear.

Specify the following values:

* **Criteria Name** — Incoming SMS.
* **Criteria for Executing Actions** — Conditions are met.
* **Set conditions:**

  * **Field:** Choose **Direction** .
  * **Operator:** Choose **Equals** .
  * **Type:** Choose **Picklist** .
  * **Value:** Choose **Inbound** .

![Flowchart for Twilio message criteria with inbound SMS condition.](https://docs-resources.prod.twilio.com/a7314a4e2ab869cd6b919928ae0e75ffbf991b8839f51793f981ea96197e2436.png)

Once you've specified those conditions, click the blue **Save** button at the bottom of the panel.

## 4. Specify your action

Now that you have a trigger and criteria set up so that your process will only execute actions for an inbound message, you can trigger different types of events within Salesforce such as email or Chatter. For this example, we'll post to Chatter.

First, click on **Add action** in the **Immediate Actions** box. Then specify the following values in the side-panel that appears:

* **Action name:** `Post to Chatter`, or a custom name of your choice.
* **Post to:** Select **Chatter Group** .
* **Group:** Select the group you wish to post to. In our example, it's **SMS Notifications** . Read this [Salesforce documentation about setting up a Chatter group](https://help.salesforce.com/articleView?id=collab_group_creating.htm\&type=5) if you do not have one configured.

For the message, click on **Merge field** and add **Number Unformatted** as well as **Body** . You should end up with the following in your message field:

```bash
New Message from {![TwilioSF__Message__c].TwilioSF__From_Number_Unformatted__c}: {![TwilioSF__Message__c].TwilioSF__Body__c}
```

![Post Twilio SMS to a Chatter group in Salesforce.](https://docs-resources.prod.twilio.com/8b5e9946d5a59530877e071f1d59430b73e4cd74db053c7f925654009e4b7b6f.png)

## 6. Activate your Action and test

Click on the blue **Activate** button in the top-right corner of the Process Builder window. Now try texting a message to your Salesforce instance. You should see new messages arriving in your Chatter group:

![Salesforce Chatter SMS Notifications group with a new message saying 'Hi Salesforce!'.](https://docs-resources.prod.twilio.com/3cc090b934fac88f846b45a456f9054948a4f504fe098eeb43c9f7e90b891c3e.png)

> \[!NOTE]
>
> Alternatively, you can also post the Chatter directly to the message owner, instead of a group.
>
> Your configuration to post a Chatter to user will be:
>
> * **Post to** : Select **User** .
> * **User** : Choose **Select a User from the Record** .
> * **In the Search box** : `[TwilioSF__Message__c].Owner:User.Id`.
