Flows: Automatically create new records in a Message program

With Flows, you can easily add records to Message from Salesforce using either Message Sync or Message for Salesforce.  

Step 1: Navigate to Flows

Start off by logging into Salesforce as an administrator.  To get to the Process Builder in Lightning, click on the gear icon and go to Service Setup -> Process Automation -> Flows.

Step 2: Create a new Flow

Click the New Flow button to get started. Select Record-Triggered Flow and the click the Create button to continue. 




Step 3: Configure your Flow start

The Flow Start defines the record conditions that you want to trigger the flow. For instance, if you want to add a record to Message when a Contact is updated with a mobile phone number, you'll follow this path:

Select Object

Under Select Object, select the record type that you want to use to trigger the flow. This is usually something like Contact, Lead or Opportunity. In our example, we'll choose Contact.

Configure Trigger

The trigger is what event causes the Flow to start. In our example, we want to trigger the Flow when a record is created or updated.




Set Entry Conditions

The conditions determine whether the triggered record is going to enter the Flow. Since our example only wants Contacts that have a mobile phone number, we want to set our Entry Condition to ensure mobile number isn't blank.

First we'll want to set Condition Requirements to All Conditions Are Met (AND). Remember this is just for our example. Your conditions may be AND, OR or more complex Custom Logic conditions. 

Next we'll search Fields for MobilePhone. This is a default field on the Contact. Any field on your selected Object is available.

Now we set the Operator and Value. In our case, we'll set the operator as Does Not Equal and choose the $GlobalConstant.EmptyString Equivalent to empty string (not null) option. I know, Salesforce really knows how to make things simple and obvious.




When to Run the Flow

Lastly, we need to specify when we want the Flow to run. In most cases, you'll choose the Only when a record is updated to meet the condition requirements option. This will ensure that the Flow only runs when the criteria are changed to meet the conditions, instead of any time a record meeting the conditions is changed.

Once you've done that, you'll have something that looks like this:




Now you can click Done. You'll be taken to a Flow that looks like this:



Step 4: Add the record to Message

You're almost finished, now we need to tell the Flow how to queue the new record up to be sent to Message.  To do that, click (+) button and select Create Records element (it's near the bottom). This will popup a configuration window. First give it a name. For our example, let's call it Add to Message. The API name will automatically be created once you leave that name field. For How Many Records to Create, you'll set it to One. For How to Set Record Fields, set that to Use separate resources, and literal values.

You'll need to select an Object again, but this time we're using a custom object just for Message. Select Message Participant Sync Object from the list. It's easier if you just type it in. You do not want to select the Share: Message Participant Sync Object. It won't have what you need. 

Now you'll need to add these fields:

  1. svmessaging__Customer_ID__c - set this to your record Id by going to Record and then Id (or you can paste {!$Record.Id} into the value field.
  2. svmessaging__Program_Name__c - this is the name of the program you want your record to be added to. This needs to match the program name as seen in the Programs tab within our Salesforce app. For this example, let's add the contact to Student-Success.
  3. (Optional) svmessaging__Group__c - you can assign a group when they're added, such as New Students. It's not required, but there are times you may want to do so.

Now you should have something that looks like this:





Just click Done and we're back at the Flow.




Step 6: Save and Activate

Now just click the Save button on the top right and give your Flow a name. Once you save, you'll now have an Activate button at the top right. Once you Activate your Flow, records will start being sent to Message!


And that's it. Flows can be as simple or complex as you need them to be. The complexity is almost always in the conditions, but we're happy to help when we can. Feel free to reach out to our support team if you need our assistance.


Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request



Article is closed for comments.