Knowledge Base > Salesforce > Advanced – Automate Business Processess with Process Builder

in Salesforce

This tutorial will show you how to build a new process in Process Builder and an SMS reminder the day before a meeting.

 

The steps to building the process in Process Builder:

Step 1 – Build a template of a reminder SMS message in inwise.

Step 2 – Build the Process Builder Processes in Salesforce.

Step 3 – Create and enable automation in inwise.

*Note*

Before you begin, in order to build and run these processes, a new text field must be created on the “Event” object to convert the default date and time field into text.
Example of a field name – “MeetDate”.
In addition, two text fields must be created on the “Contact” object: a meeting date field and a meeting hour field. Examples of names for fields – “appDate” and “appHour”.
Then, the “Meeting Date” and “Meeting Time” fields should be created in inwise as text fields using the inwise field mapping guide.
Finally, these fields must be mapped in inwise for Salesforce addon field mapping.

This guide can be used (section 4).

 

Step 1 – Build an SMS template in inwise

The first step is to create an SMS message draft inside inwise which will contain the text and personal fields you want to send.
In the black menu bar on the left side of the screen click on “campaigns”.

Under the “Common Operations” panel on the right side of the screen, select “Create SMS Campaign”. You can use the “Create an SMS Campaign” guide.

  1. Update the campaign name. (e.g. “Reminder before the meeting”).
  2. Edit and formulate the content of the message.
  3. We recommend adding personal fields to the message. To do this, place the cursor on the position in the message where you want to add the personal field, click on “Add a personal field” and select the relevant field.

We recommend including a link for contacts to remove themselves from the mailing list – more information in this guide (step 2 – Add unsubscribe link).

      4. Finally, click “Save” to save the SMS you created as a draft (you will return to this in the third and final step of the guide).

 

Step 2 – Build the Processes in Process Builder

In Salesforce, enter the Process Builder screen by clicking on “Setup” and in the Quick Search pane type “Process Builder”.
You will build 2 processes:

1. The first process – will automate SMS delivery in inwise.

2. The second process – he day before the meeting, the date and time fields will be converted and split into two text fields, then the First process should be activated.

The first process

An Invocable process, which includes an inwise automation activation (Apex operation) by a unique identifier that delivers an SMS message.
Create a new process – Click “New” and define a name for the process, (e.g. “Send SMS”.)
If necessary, a description can be added to the process.
Next, define the activation of one process when it is summoned from another process.
Choose – “It’s invoked by another process”.
When done, click “Save”.

 

To set the process to be performed on an “Event” object click “Add Object”.
Select from the drop-down list on the left – “Event”.
When done, click “Save”.

 

At this point, you may add the criteria that you want to check before performing the action.
The conditions can be created according to unique settings and characteristics. In this example you do not need a condition, so simply run the action.

Click on “Add Criteria” to define a name for the condition, (e.g. “No Criteria”.)
Select the option “No criteria – just execute the actions”.
Finally, click “Save”.

 

 

Now, you will add the action you want to take if the criteria is met.
Next, select the apex of the automation trigger in inwise, which will send an SMS.

  1. Click on “Add Action”. Select and define each field.
  2. To define “Action Type” – Select “Apex”.
  3. To define “Action Name” – Select a relevant name for the action, for example, “Send SMS”.
  4. In the “Apex Class” field – Clicking on the drop-down list will open a proposal for completion, select Inwise__Inwise Automation Trigger.
  5. For the “Set Apex Variables” field – Click on “Add Row”.

 

  1. In the “Field” field – Clicking on the drop-down list, here again, will open a proposal. Select “trigger_identifier”.
  2. For the “Type” field – select “Formula”.
  3. In the “Value” field – Click on “Build a formula”. A white window will open below for the purpose of inserting the formula.
  4. Because you want to add the contact’s information to the SMS (Contact Object), which is linked to an event, copy and paste the following formula:
    ‘[{“RecordID”:”‘+[Event].WhoId+'”,”trigger_identifier”:”‘+”999“+'”}]’


The formula transfers the entity associated with an object such as Event – using [Event].WhoId.
In other cases, the contact entity can be moved directly if the object on which the action is performed is a contact – Using [Contact].Id.

Formula:

‘[{“RecordID”:”‘+[Contact].Id +'”,”trigger_identifier”:”‘+”Trigger Identifier“+'”}]’

The same goes for the case of Lead – Using [Lead].Id.

Formula:

‘[{“RecordID”:”‘+[Lead].Id +'”,”trigger_identifier”:”‘+”Trigger Identifier“+'”}]’


Under ‘Trigger Identifier’ – a unique identifier must be provided for the operation so that you can select that identifier in the automation inside inwise.

Identifier example – 999.

  1. Click on “Use This Formula” and click “Save”.

 

The first process is completed. You can now click “Activate” at the top right of the screen to start the process.
Don’t worry, this is an invocable type process and will not run until you call it in the second process.

The second process

Each time a meeting is created or updated, the day before the meeting, a date and time field will be converted to a text field and divided into two separate fields under the contact: meeting date and meeting time.

The conversion and division are done in order to move the meeting date and meeting time individually at the contact level (in addition to all the information contained in the contact record and is done by mapping contact fields).
Finally, you can activate the first process to automatically send the SMS in inwise.

Create a new process – click on “New” and define a name for the process, for example, “Meeting Reminder”.
If necessary, a description can be added to the process.
Select the process to run when –  “A record changes”.
When done, click “Save”.

 

 

Set the process to be performed on an “Event” object, and begin when a record is created or edited.
Click on “Add Object”.
Select the drop-down list on the left in “Event”.
Select the process to start when a record is created or edited – “when a record is created or edited”
To finish click “Save”.

At this point, the criteria to test before performing the action. Again note that each organization can make conditions according to its own unique definitions and characteristics. In the example,  check that the date and time field is not empty.

  1. Click on “Add Criteria”.
  2. Define a name for the condition, for example, “Check if Exists”.
  3. In the Set Conditions fields, select the event date and time field – called  [Event].StartDateTime, and check that it is not empty by using an operator called “Is Null”, when its Type is ‘Boolean’ and the value is ‘False’.
  4. In the Advanced field, select ‘Yes’ so that the action does not take place immediately, but later.
  5. Finally, click “Save”.

The next stage is to add the desired action once the criteria are met. To do this, follow these steps:

  1. Schedule the action date to be made one day before the date and time of the meeting.
  2. Set the date and time field conversion to a new text field under the Event, breaking the text field into two different fields under the ‘Contact’:
    Export and update meeting date field.
    Export and update meeting time field.
    These actions will be performed by using formulas under the Record Update action.

Scheduled Actions

In the ‘Scheduled Actions’ field, click on ‘Set Schedule’ and select the time you want the actions to take place. (e.g. one day before the date and time of the meeting).
Now click “Save.”

 

 

Convert the date and time into a new text field under the Event:

Under ‘Scheduled Actions’, the option to select ‘Add Action’ will appear. Define the following fields as indicated below:

  1. ‘Action Type’ – Select ‘Update Records’.
  2. ‘Action Name’ – Define an easy-to-identify name for the action. (e.g. “Text Conversion”).
  3. ‘Record Type’ – Click on the drop-down list, select “Select the Event record that started your process” ([Event]) and click “Choose”.
  4. ‘Field’ field – Select the field that was created for formatting the date and time field. (In this example “MeetDate”).
  5. ‘Type’ field – Select “Formula”.
  6. ‘Value’ field – click on “Build a formula”. A white window will open for insertion of the formula.
  7. Update the following in the white area:

LEFT(TEXT ([Event].StartDateTime + (3/24)),19)

*Note*

The number 3 must be changed according to the UTC time in your country.
At the time of writing this guide, the time was UTC+3.

  1. Click on “Use This Formula” and finally, click “Save”.

Export and update the meeting date field under the contact:
  1. Create another action, in ‘Action Type’ – Select “Update Records”.
  2. ‘Action Name’ – Define an easy-to-identify name for the action (e.g “Contact – Meet Date”).
  3. ‘Record Type’ field – click on the drop-down list, select “Select a record related to the Event” – (Name ID) and click “Choose”.
  4. ‘Field’ field – Select the field created for the meeting date under ‘contact’ object. (In this example, the field is called “appDate”).
  5. ‘Type’ field – Select “Formula”.
  6. ‘Value’ field – click on “Build a formula”. A white window will open for insertion of the formula.
  7. Update the following in the white area:

LPAD(TEXT(DAY(DATEVALUE([Event].MeetDate__c))),2, “0”) + “-” + LPAD(TEXT(MONTH(DATEVALUE([Event].MeetDate__c))),2, “0”)+”-“+ TEXT(YEAR(DATEVALUE([Event].MeetDate__c)))

*Note*

The [Event].[MeetDate] field must be replaced with the formatted text field created on the Event entity.

  1. Click “Use This Formula” and finally, click “Save”.

Export and update the meeting time field under the contact:
  1. Create another action, in ‘Action Type’ – Select “Update Records”.
  2. ‘Action Name’ – Define an easy-to-identify name for the action. (e.g. “Contact – Meet Hour”).
  1. ‘Record Type’ field – click on the drop-down list, select “Select a record related to the Event” – (Name ID) and click “Choose”.
  2. ‘Field’ field – Select the field created for the meeting date under ‘contact’ object. (In this example, a field called “appHour”).
  3. ‘Type’ field – Select “Formula”.
  4. ‘Value’ field – click on “Build a formula”, a white window will open for insertion of the formula.
  5. Update the following in the white area:

LEFT(RIGHT([Event].MeetDate__c,8),5)

*Note*

The [Event].[MeetDate] field must be replaced with the formatted text field created on the Event entity.

  1. Click “Use This Formula” and finally, click “Save”.

To finish, click “Activate” at the top right of the screen to activate the process.

Step 3 – Create and enable an automation in inwise

Now all that’s left to do is to create an automation in inwise that will send the SMS.
Navigate to the inwise system and in the black menu bar on the left side of the screen click on “Automation”.
In the “Common Actions” pane on the right side of the screen, click “Create Automation”.
Scroll down and select “Empty Automation”.
Hover your mouse over the “Trigger” (blue square) and click on the pencil icon to edit it.

Trigger Type – Select “Custom Trigger”.
Under Additional settings – ‘Identifier’ – Define the unique identifier you used in the processess inside Process Builder. (e.g. 999).
Now click “Update”.

Hover your mouse over the “Action” (green square) and click the pencil icon to edit it.
“Action Type” – Select “Send The Recipient An SMS”.
In “additional settings” – Select the SMS draft you created in advance in step 1.
In the example, the draft is called –  “Reminder before meeting”. Then click “Update.”

Click the “Continue” button on the bottom right of the screen.
On the “Publish Settings” screen, enter a name for the automation. (e.g.”Reminder before a meeting”).
And finally, hit the “Publish” button on the bottom right of the screen.

That’s it! You have finished setting up and running an inwise automation process through the Process Builder.

So what will happen now? Each contact who sets a new appointment (Event) will receive a reminder with the meeting details in an SMS the day before the meeting.
In this way, additional processes can be automated.