Salesforce
Configure exceptional multi-channel and multi-thread customer experiences in Pendula with data directly from your CRM.
-
Pendula for Salesforce Integration
Learn how to create Pendula flows for your Salesforce org
View articlesGet startedPendula for Salesforce Integration Overview
Pendula’s first-class integration to Salesforce (SFDC) allows you to configure exceptional multi-channel and multi-thread customer experiences with data directly from your CRM. The integration supports:
- triggering a Pendula flow on demand when a record is created or updated in Salesforce based on rules or criteria;
- scheduling a one-off or repeating campaign to run in Pendula to your Salesforce contacts based on rules or criteria;
- creating and updating Salesforce records based on customer responses, data from other systems or other processes for seamless automation;
- adding any Salesforce files as attachments to email journeys;
- enriching your customer journeys triggered by other systems with Salesforce data at any part of a flow;
- 1:1 messaging, exception handling and conversational history on Salesforce records with the Pendula Console;
- advanced reporting, auditing and experience history tracking with the Salesforce Activity Sync from Pendula.
How it works
Pendula triggers flows via on-demand events from SFDC or by scheduling campaigns with audiences built by querying your Salesforce CRM data. It also enables several key actions you can use at any point throughout a flow to retrieve, create or update Salesforce records. You can also sync all data from Pendula to your Salesforce environment, plus converse with your customers 1:1 directly from a Salesforce record.
For detailed information about the individual triggers, actions and capability for the Salesforce integration, see the following articles:
- Salesforce Event Trigger
- Salesforce Scheduled Trigger
- Get Salesforce Record
- Create Salesforce Record
- Update Salesforce Record
- Setting up the Pendula Console
- Salesforce Activity Sync
Integration limits
You can add up to five unique Pendula tenants to a single SFDC org, as per Salesforce limits.
Each connected app allows five unique approvals per user. After a fifth approval is made, the oldest approval is revoked.There is no limit to the number of SFDC orgs you can connect to a Pendula tenant for triggers and nodes.
You can only configure one SFDC org to receive Activity Sync events from a Pendula tenant.
Salesforce API usage and limits
Flow triggers and actions
The Salesforce event trigger has been designed to minimise the number of API calls to SFDC, which is why the integration uses the ‘Outbound Messages’ feature of SFDC flows. This feature does not consume any API calls.
The Salesforce scheduled trigger consumes 1 API call per invocation for n matching experiences. In other words, every time the schedule runs (e.g., at 9:00 a.m. every day), Pendula will use just 1 call to query the Salesforce org and then trigger all the experiences for records that match that query.
Each time an experience runs through the Pendula flow and uses a Get record action, 1 API call will be consumed from the SFDC allowance.
Each time an experience runs through the Pendula flow and uses the Create record action, 1 API call will be consumed from the SFDC allowance.
Each time an experience runs through the Pendula flow and uses the Update record action, 1 API call will be consumed from the SFDC allowance.
Each time an experience runs through the Pendula flow and uses the Get files action, n(number of files requested) + 1 API calls will be consumed from the SFDC allowance.
In practice, with an event-triggered flow with 10,000 recipients, you will consume 10,000 API calls per action node. If you have two action nodes in a flow (a Get record and an Update record, for example), you will consume 20,000 API calls.
Activity sync
Activity Sync for Salesforce has been designed to balance the number of API calls to SFDC with the speed of syncing data. Activity Sync will consume at least 1 API call for every 10 events, however, it may consume more depending on your particular usage patterns.
How many events do activities generate?
- Inbound SMS creates 1 activity sync event
- Outbound SMS creates 2-3 activity sync events (depending on whether the SMS passes validation)
- Outbound emails create 2-4 activity sync events (depending on whether the email passes validation or bounces)
Pendula does not throttle or control API usage. It is up to you to plan and manage your campaigns according to your API allowances of the Salesforce organisation.
Next steps
Authenticating SFDC with Pendula
For building flows within the Experience and Workflow Canvas using Salesforce triggers and actions, you must authenticate your Salesforce org/s to your Pendula tenant.
Please see this article for step-by-step instructions.
Deploying the Pendula Managed Package to your SFDC environment
To enable the Pendula Console and Activity Sync you will need to install the Pendula Managed Package into your Salesforce Environment. Talk to our team to get started.
How toSalesforce event trigger
Setting up the trigger
The Salesforce event trigger can be configured to trigger a Pendula flow when:
- A record is created
- A record is updated to meet condition requirements
- A record is created or updated to meet condition requirements
The trigger does not support "record updated every time a record is updated and meets the condition requirements" — i.e. using
IsChangedtrigger conditions. This prevents unwanted triggering of flows and communications when users within Salesforce update records. To supportIsChangedflows, see the Advanced use cases and known workarounds below.The event trigger supports the majority of standard, special and custom objects associated with the connected Salesforce organisation. It supports the following additional triggering criteria:
- None (trigger the flow on the creation or update of any record of that type of object)
- Any condition is met (
OR) - All conditions are met (
AND) - Custom condition logic is met, e.g.
1 AND 2 AND (3 OR 4)
The flow will fire only from data in the triggering object and include all available fields on that object (including custom fields). To bring more data in for use within the flow — for example, related records such as the Contact object — use the Get record in Salesforce action.
Adding criteria
The event trigger currently does not support visualising system values associated with any fields from SFDC (for example, picklist values). You must enter the correct values when building the criteria that will trigger the flow.
The format of the fields used in configuring criteria will need to adhere to the SFDC API formats:
Date-specific fields in Salesforce →
To configure a boolean field you must enter
trueorfalseinto the value field.For picklist and boolean fields (apart from
is null), the value is not case-sensitive.How to add and find IDs for ID fields
For specific record IDs: Access the required record ID in your web browser. The URL displayed in the browser address bar contains both the Salesforce instance and the Record ID.
Salesforce Classic example
URL:
http://na1.salesforce.com/5003000000D8cuIRecord ID:5003000000D8cuILightning Experience example:
URL:
https://na1.lightning.force.com/lightning/r/Case/5003000000D8cuIQAA/view?0.source=alohaHeaderRecord ID:
5003000000D8cuIQAAUsing the
is nulloperatorThe Get Salesforce records trigger supports the use of the
is nulloperator. The value must be set totrueorfalse, and is case-sensitive. This operator will only work on nullable fields in Salesforce.Activating the Pendula flow
Upon activation of a Pendula flow with the Salesforce event trigger, an SFDC flow with the type ‘Record-Triggered Flow’ will be created and activated.
You will see the associated Pendula flows in your SFDC flows list as:
PendulaFlow{{PendulaFlowID}}-{{Flow Version}}.Editing the Pendula flow
You can edit flows using the Salesforce record event trigger as normal in Pendula.
Activating a new version of the Pendula flow will create a new SFDC flow in Salesforce with the updated version number (
PendulaFlow{{PendulaFlowID}}-{{Flow Version}}).For the previous Pendula flow version that has been replaced or terminated, the corresponding SFDC flow will then be deactivated but not deleted. This is best practice in SFDC, allowing an audit trail of all flows created to remain in the Salesforce org and support troubleshooting where required.
Troubleshooting
If the SFDC flow fails to be created after you have configured the trigger, the Pendula flow will display in the ‘Error’ state. This usually is because of the flow entry criteria you have configured. Check the syntax of the criteria value carefully and ensure that it uses the correct format. See below for the correct Salesforce formats.
The format of the fields used in configuring criteria will need to adhere to the SFDC API formats:Date-specific fields in Salesforce →
Advanced use cases
Pendula supports the ability to modify an SFDC flow directly for more advanced use cases. The SFDC flow name cannot be changed.
If you modify the flow in SFDC but then activate a new version of the Pendula flow, you must make the same changes to the new SFDC flow created from the new Pendula flow version.
Examples of advanced use cases that require editing the SFDC flow directly:
- Using a formula to define a record change from a value on a parent object (i.e. number of days since DATE() on the parent object)
- If you are receiving a DLM error (details below) and have a requirement to use Asynchronous paths in SFDC
- To include a Run Asynchronously path to access an external system after the original transaction for the triggering record is successfully committed.
- To trigger a flow every time a record is updated and meets the condition requirements - i.e. using "IsChanged" trigger conditions supported by SFDC flows
- For using ‘fast field updates’ supported by SFDC flows
- To trigger a flow when a record is deleted (Note: this may cause unexpected behaviour if the deleted record/s merge fields do not pass their value through as a result of the record being deleted)
Current known limitations & workarounds
Pendula is regularly releasing updates and fixes for limitations where possible and appropriate. We will continue to update the list below as more capability becomes available.
Limitation Workaround (if applicable) Criteria value validation: the event trigger currently does not support visualising system values associated with any fields (for example, picklist values). You must enter the correct values when building the criteria that will trigger the flow. The format of the fields used in configuring criteria will need to adhere to the SFDC API formats:
Date-specific fields in Salesforce →
For picklist and boolean fields (apart from
is null), the value is not case-sensitive.Date literals: The event trigger does not support date literals or date formulas. (e.g. or TODAY). They are supported if writing formula criteria in triggered events. SFDC recommends using a formula field if date literals are required to trigger the flow. Operators: the following operators are supported on the event trigger:
- equal to
- not equal to
- greater than
- greater than or equal to
- less than
- less than or equal to
- starts with
- ends with
- contains
- is null
The type of field does not filter operators. The incorrect operator with field type (e.g. less than on a string) may error the flow or cause expected results.
Note that is nullis a boolean operator and supportstrueandfalsevalues. These are case-sensitive.Polymorphic fields: Polymorphic fields, e.g. Owner (User, Group), are not currently supported and won't be available as a field from Salesforce. IsChanged: "record updated every time a record is updated and meets the condition requirements" For IsChangeduse cases where the field is being edited from nothing to a value, specify isis nullequalsfalseon the field being edited.Geolocation fields: Geolocation fields cannot be selected as criteria in the event trigger and are not available as merge fields in subsequent nodes in the flow. This is due to a known Salesforce issue. Salesforce suggest creating separate custom fields for latitude and longitude, and using a Salesforce trigger or flow to populate these fields when a geolocation field is updated. Excluded field types: Compound fields cannot be selected as criteria in the event trigger and are not available as merge fields in subsequent nodes in the flow.
Subclass fields can be selected and are available unless they are one of the following types:
-
textarea(not supported by SOQL WHERE clauses) -
encryptedstring(not supported by SOQL WHERE clauses) -
location(excluded due to a known Salesforce issue) -
time(excluded due to a known Salesforce issue)
Note that some fields may or may not be included in
related* merge fields later in the flow.
Values for fields of type "Time" or "Location" can be retrieved by using the Get Salesforce record node after the event trigger.Excluded fields: These fields cannot be selected as criteria in the event trigger and are not available as merge fields in subsequent nodes in the flow:
Case__BusinessHoursIdWorkOrder__BusinessHoursIdUser__CallCenterIdUser__UserPermissions*User__UserPreferences*User__EmailPreferences*
How toSalesforce scheduled trigger
Scheduled flows are set to trigger at a specific point in time.
This can be once-off, or set to repeat hourly, daily, on specific days, weekly, or monthly, with an optional end date.
Similar to an event-triggered flow, a scheduled flow has criteria that still must be met; however, you have control over when it will trigger and send.
Setting up the trigger and adding criteria
On the Settings tab, select the triggering object for your campaign.
The Add criteria section allows you to specify your flow criteria by referencing fields that coincide with any objects that share a one-to-one relationship with the object you have selected for your triggering object. To set a rule, search for (or browse) and select the relevant field name from the Field dropdown.
You can add additional data from SFDC using the Get Salesforce record action in a subsequent node in the flow.
Select the desired
OperatorandValueto complete your rule.Click on the Add rule button to further segment recipients. Adding more than one rule also allows you to specify whether the flow should trigger based on all or any of the rules outlined.
You can also create a group of rules by clicking on the Add group button. Once more than one rule is added to a group, you can apply an all or any to your group of rules. This allows you to nest a series of any statements within your all statements, for example, all Contacts with a
Statusequal toCurrent, withRegionequal to eitherNSWORQLDThe ‘record count’ above the criteria builder shows you how many records match the criteria you have selected. If you do not add any rules to your contact filters, the flow will send to ALL records based on the selected object.
The event trigger currently does not support visualising system values associated with any fields from SFDC (for example, picklist values). You must enter the correct values when building the criteria that will trigger the flow.
The format of the fields used in configuring criteria will need to adhere to the SFDC API formats:
Date-specific fields in Salesforce →
To configure a boolean field you must enter
trueorfalseinto the value field.For picklist and boolean fields (apart from
is null), the value is not case-sensitive.How to add and find IDs for ID fields
For specific record IDs: Access the required record ID in your web browser. The URL displayed in the browser address bar contains both the Salesforce instance and the Record ID.
Salesforce Classic example
URL:
http://na1.salesforce.com/5003000000D8cuIRecord ID:5003000000D8cuILightning Experience example:
URL:
https://na1.lightning.force.com/lightning/r/Case/5003000000D8cuIQAA/view?0.source=alohaHeaderRecord ID:
5003000000D8cuIQAACreate a campaign schedule
On the Schedule tab, select the date and time you would first like the flow to run. You can enter manual dates and times following the format
27/02/2021or09:25(24hr time only) or by clicking on the icons on each field.By default, the Timezone field will be populated using the timezone of your browser. You can edit this by clicking on the field and then searching for your preferred option.
Add a recurring schedule by clicking the Repeats toggle.
You can set the flow to repeat:
- Every hour
- Every day
- On specific days (e.g. Mondays and Wednesdays)
- Every week
- Every month
Note that you cannot set the schedule to repeat on the 29th, 30th, or 31st of the month, as not all months have those dates. The node will display an error.
By default, the flow will continue to trigger indefinitely based on the chosen frequency until it is deactivated. Alternatively, you can also add an optional end date by clicking ends on and adding your preferred date.
Scheduled flows are a great way to automate any repetitive or consistent communications that should be sent on a regular basis. Common examples include a happy birthday SMS, 24hr appointment reminders and monthly invoice or payment notifications.
Activating the Pendula flow
Unlike event-triggered flows, scheduled flows do not create a corresponding SFDC flow in your Salesforce org. Upon activation of the scheduled flow, Pendula creates a SOQL query that will call to SFDC every time the schedule runs.
Each time the scheduled trigger creates a flow, the number of experiences created will match the number of matching records for the query at that point in time:
- On Tuesday at 9.00am, there are 200 records that match the SOQL query in the trigger. The flow will create and send 200 experiences.
- On Wednesday at 9.00am the query matches 150 records, the flow will create and send 150 experiences, and so forth.
Using Salesforce formulas
You can use SFDC Date Literals and Date Formulas in your query. Read more about using these formulas here.
Using the
is nulloperatorThe Salesforce scheduled trigger supports the use of the
is nulloperator. The value must be set totrueorfalse, and is case-sensitive. This operator will only work on nullable fields in Salesforce.Using the
likeoperatorYou can use the like operator with supported formulas in your query. The
likeoperator matches single characters and patterns found anywhere in a string—beginning, ending, or somewhere in-between.Use case Formula Find any values that start with
aa%Find any values that end with an
a%aFind any values that have
orin any position%or%Find any values that have
rin the second position_r%Find any values that start with
aand are at least 2 characters in lengtha_%Find any values that start with
aand are at least 3 characters in lengtha__%Find any values that start with
aand end withoa%oMatch any single character in the string.
For example, to filter on a list of countries, a pattern of
_a_a___will return Bahamas and Jamaica.Underscore (
_)Match any pattern in the string.
Starting a pattern with a percent sign returns all words that end with the specified characters. The percent sign indicates that any number of characters can precede the specified ones.
Ending a pattern with a percent sign returns all the words that begin with the specified characters. Any number of characters can follow the specified ones. To match a pattern anywhere in a string, the pattern must start and end with a percent sign.
For example, to filter on a list of countries, a pattern of
%a%a%returns Bahamas, Jamaica, Slovakia, and Trinidad and Tobago.Percent sign (
%)Include a literal percent sign or underscore in a pattern
Escape with a backwards slash (
\)Additional wildcard characters and regular expressions aren’t supported.
Editing the Pendula flow
You can edit flows using the Salesforce scheduled trigger as normal in Pendula. See this article for more details on editing active flows.
Troubleshooting
A schedule must be set in the future for a flow to be activated successfully. Before you activate a flow, double-check the trigger schedule on the ‘Schedule’ tab of the node configuration screen.
If a selected schedule cannot be achieved - e.g. if you select an Ends date that is before the first repeat - the flow will go into an ERROR state. To resolve this, edit the flow and select a date range that can be scheduled.
The query for the schedule must display the record count on the trigger node for the flow to trigger correctly. Check the syntax of the criteria value carefully and ensure that it uses the correct format. See below for the correct Salesforce formats.
Date-specific fields in Salesforce →
Current known limitations & workarounds
Pendula is regularly releasing updates and fixes for limitations where possible and appropriate. We will continue to update the list below as more capabilities become available.
Limitation Notes Excluded field types: Compound fields cannot be selected as criteria in the scheduled trigger and are not available as merge fields in subsequent nodes in the flow.
Subclass fields can be selected and are available unless they are one of the following types:
-
textarea(not supported by SOQL WHERE clauses) -
encryptedstring(not supported by SOQL WHERE clauses)
Note that some fields may or may not be included in
related* merge fields later in the flow.Excluded fields: These fields cannot be selected as criteria in the scheduled trigger and are not available as merge fields in subsequent nodes in the flow:
-
Case__BusinessHoursId -
WorkOrder__BusinessHoursId -
User__CallCenterId -
User__UserPermissions* -
User__UserPreferences* -
User__EmailPreferences*
Operators: the following operators are supported on the scheduled trigger:
- equal to
- not equal to
- greater than
- greater than or equal to
- less than
- less than or equal to
- like
- is null
The type of field does not filter operators. The incorrect operator with field type (e.g. less than on a string) may error the flow or cause expected results.
Note that
is nullis a boolean operator and supportstrueandfalsevalues. These are case-sensitive.Polymorphic fields: Polymorphic fields, e.g. Owner (User, Group), are not currently supported and won't be available as a field from Salesforce. Record limits: Flows that use the Salesforce scheduled trigger node should be limited to 25,000 records to ensure timely execution of the experiences. How toGet Salesforce record
The Get record action allows you to bring in any data from SFDC to personalise customer experiences within a Pendula flow.
The Get record node supports the majority of standard, special and custom objects associated with the Connected Salesforce organisation.
Configuring the node
Select primary record
You can bring any record data into a Pendula flow by fetching the record by creating a query in this step.
The query builder supports merge fields and exact values. Enter a merge field from the trigger node (or any other node/integration previously used within the flow) associated with the selected object.
You can use the query builder to get records from Salesforce for the following common use cases:
- Get record by ID: using the ‘Contact ID’ from the triggering object (e.g. Opportunity or Case) to bring in all the contact details for a recipient into the flow.
- Get record by recipient ID (e.g. mobile or email address): you can use the ‘Get record’ node after the inbound message trigger to enrich the flow with information from your CRM to triage and handle inbound message enquiries. You can also bring in data from Salesforce if you are using a recipient ID as an identifier (e.g. email address) to make the flow more personalised and perform more actions in the customer journey.
Use case: get records by ID
How to add and find IDs for ID fields
For specific record IDs: Access the required record ID in your web browser. The URL displayed in the browser address bar contains both the Salesforce instance and the Record ID.
Salesforce Classic example
URL:
http://na1.salesforce.com/5003000000D8cuIRecord ID:5003000000D8cuILightning Experience example:
URL:
https://na1.lightning.force.com/lightning/r/Case/5003000000D8cuIQAA/view?0.source=alohaHeaderRecord ID:
5003000000D8cuIQAAHow to find merge field ID
You can search for and find the correct merge field by clicking the green data explorer button on the field itself. If you want to make sure of the node your merge field is coming from, you can find it manually using the steps below.
Fields such as ID in SFDC will display as ID in the Object Manager, but will show in the Data Explorer view (merge field tab) in Pendula "AccountID".
From the trigger node (or a previous Get node) you can find the ID of the related record by using the data explorer under the ‘merge field’ tab. Navigate to This node > record > ContactID (or another lookup ID if required) and clicking ‘copy’. Copy this merge field into the Get record node.
Pendula does not validate the format or data for the referenced value in the query. If the format is incorrect, the experience will continue down the failed path.
Select related record(s)
You may select up to 5 related records from the primary record selected in the previous step.
You can use the fields and data from these records in subsequent nodes throughout the flow. The merge fields will follow the syntax
{{nodeId.related#.fieldname}}, eg.{{ comPendulaSfdcGetRecordV1_1.related2.CreatedById }}You can add this data via the merge fields tab in subsequent nodes, or using the merge field button in supported fields.
It's important to note that the Get record node will progress through the flow only if ALL the records specified are retrieved. If one or more records fail to be retrieved, the experience will progress down the Not found outcome path (if configured) or end at that node. See below for more details on the outcomes for this node, and this article on configuring node outcomes for experiences.
Depending on your use case, you may want to:
- Allow the experience to fail if a record is missing by not configuring an outcome path;
- Configure an outcome path with a different message (without personalised data) or a fallback journey;
- Configure more than one Get record node in a sequence if you are more certain of some existing records than others.
Using Salesforce formulas
You can use SFDC Date Literals and Date Formulas in your query. Read more about using these formulas here.
Using the
is nulloperatorThe Get Salesforce records trigger supports the use of the
is nulloperator. The value must be set totrueorfalse, and is case-sensitive. This operator will only work on nullable fields in Salesforce.Using the
likeoperatorYou can use the like operator with supported formulas in your query. The
likeoperator matches single characters and patterns found anywhere in a string—beginning, ending, or somewhere in-between.Use case Formula Match any single character in the string.
For example, to filter on a list of countries, a pattern of
_a_a___will return Bahamas and Jamaica.Underscore (
_)Match any pattern in the string.
Starting a pattern with a percent sign returns all words that end with the specified characters. The percent sign indicates that any number of characters can precede the specified ones.
Ending a pattern with a percent sign returns all the words that begin with the specified characters. Any number of characters can follow the specified ones. To match a pattern anywhere in a string, the pattern must start and end with a percent sign.
For example, to filter on a list of countries, a pattern of
%a%a%returns Bahamas, Jamaica, Slovakia, and Trinidad and Tobago.Percent sign (
%)Include a literal percent sign or underscore in a pattern.
Escape with a backwards slash (
\)Additional wildcard characters and regular expressions aren’t supported.
For picklist and boolean fields (apart from
is null), the value is not case-sensitive.Formats returned by the Get record node
Date Returns in ISO date: 2024-06-01
Format in Salesforce: 1/6/2024
Time Returns in epoch time: 1679338791000 Currency Returns the value with no formatting "35000000" Outcome paths
Success path: the experience will continue down this path if all records are successfully retrieved.
Failed: the experience receives an unexpected failure from Salesforce. If this outcome path is switched OFF, the experience will end and be marked as ‘failed’ in History. If this path is switched ON the experience will continue down that path to the next configured node.
Not found: the experience fails to retrieve some or any of the specified records from Salesforce. If this outcome path is switched OFF, the experience will end and be marked as ‘failed’ in History. If this path is switched ON the experience will continue down that path to the next configured node.
Current known limitations & workarounds
Pendula is regularly releasing updates and fixes for limitations where possible and appropriate. We will continue to update the list below as more capabilities become available.
Limitation Notes Excluded field types: Compound fields cannot be selected as criteria in the get record action and are not available as merge fields in subsequent nodes in the flow:
Subclass fields can be selected and are available unless they are one of the following types:
-
textarea(not supported by SOQL WHERE clauses) -
encryptedstring(not supported by SOQL WHERE clauses)
Note that some fields may or may not be included in
related* merge fields later in the flow.Excluded fields: These fields cannot be selected as criteria in the get record action and are not available as merge fields in subsequent nodes in the flow:
Case__BusinessHoursIdWorkOrder__BusinessHoursIdUser__CallCenterIdUser__UserPermissions*User__UserPreferences*User__EmailPreferences*
Field validation: the node currently does not support visualising system values associated with any fields (for example, picklist values). This means you must enter exactly the correct values when entering the desired value, otherwise the experience will fail. For picklist and boolean fields (apart from
is null), the value is not case-sensitive.The format of the fields used in configuring criteria will need to adhere to the SFDC API formats:
Polymorphic fields: Polymorphic fields, e.g. Owner (User, Group), are not currently supported and won't be available as a field from Salesforce. Parent-to-child relationships: You can only move from a child record to a parent record to ensure no arrays are returned to the flow. Operators: the following operators are supported on the Get record action:
- equal to
- not equal to
- greater than
- greater than or equal to
- less than
- less than or equal to
- like
- is null
The type of field does not filter operators. The incorrect operator with field type (e.g. less than on a string) may error the flow or cause expected results.
Note that is nullis a boolean operator and supportstrueandfalsevalues. These are case-sensitive. -
Salesforce Managed Package: Pendula Console & Activity Sync
Learn how to add the Pendula for Enterprise managed package to your Salesforce org, and send and receive messages with the Pendula Console
View articlesReferencePendula Salesforce Package architecture and objects
This article describes the architecture, message flow and objects of the Pendula Salesforce Package.
The Pendula package provides the following features for Salesforce customers.
Pendula tenant to Salesforce
Messages sent to or from your Pendula tenant are synchronised to your Salesforce org after you install the Pendula manage package.
These messages include flow, message and experience data, written to the custom objects associated with the Pendula package.
Customers using the Pendula Console can see the complete history of any messages sent to or received from a selected recipient.
Activity Sync
Activity Sync sends a record of all inbound and outbound activity within your Pendula instance to your Salesforce org, and writes that data to the Pendula Message and Pendula Message Event objects.
Recipient Matching
When a message is sent from or received by Pendula, the message includes details about the recipient that received or sent the message.
This information is used to automatically match the message to an existing record within your Salesforce org. If no match is found, the message appears as an Unmatched message type in the list of message records.
Pendula Salesforce objects
The Pendula for Enterprise Salesforce package contains four custom objects.
Console Message
The Console Message object records outbound messages sent from the Pendula Console to a customer.
Field Label Field Name Data Type Actioned Pendula4E__Actioned__cCheckbox Body Pendula4E__Body__cText Area(32768) Console Message Number NameAuto Number Contact Pendula4E__Contact__cLookup(Contact) Created By CreatedByIdLookup(User) Last Modified By LastModifiedByIdLookup(User) Lead Pendula4E__Lead__cLookup(Lead) Message Date Time Pendula4E__Message_Date_Time__cDate/Time Owner OwnerIdLookup(User,Group) Person Account Pendula4E__Person_Account__cLookup(Account) ToNumber Pendula4E__To_Number__cPhone User Pendula4E__User__cLookup(User) Message
The Message object records inbound messages sent from Pendula to Salesforce.
Field Label Field Name Data Type Values Body Pendula4E__Body__cLong Text Area(32768) Channel Pendula4E__Channel__cPicklist SMS
EmailConsole Message Pendula4E__Console_Message__cLookup(Console Message) Created By CreatedByIdLookup(User) Direction Pendula4E__Direction__cPicklist Outbound
InboundEmail Body HTML Pendula4E__Email_Body_HTML__cLong Text Area(131072) Email Body Plain Text Pendula4E__Email_Body_Plain_Text__cLong Text Area(131072) Email From Address Pendula4E__Email_From_Address__cText(80) Email Reply To Pendula4E__Email_Reply_To__cText(80) Email Subject Pendula4E__Email_Subject__cText Area(255) Email To Address Pendula4E__Email_To_Address__cText(80) Experience Id Pendula4E__Experience_Id__cText(255) (External ID) Flow Id Pendula4E__Flow_Id__cText(36) (External ID) Flow Name Pendula4E__Flow_Name__cText Area(255) Flow Version Pendula4E__Flow_Version__cText(5) From Number Pendula4E__From_Number__cPhone Last Modified By LastModifiedByIdLookup(User) Message Date Time Pendula4E__Message_Date_Time__cDate/Time Message Id Pendula4E__Message_Id__cText(36) (External ID) (Unique Case Sensitive) Message Number NameAuto Number Node Id Pendula4E__Node_Id__cText Area(255) Node Name Pendula4E__Node_Name__cText Area(255) Output Name Pendula4E__Output_Name__cText Area(255) Owner OwnerIdLookup(User,Group) Record Type RecordTypeIdRecord Type Reply Match Type Pendula4E__Reply_Match_Type__cPicklist Exact Match (Conversation)
Exact Match (Trigger)
Rule Match (Conversation)
Rule Match (Trigger)
UnmatchedReply Path Label Pendula4E__Reply_Path_Label__cText(25) SMS Segment Count Pendula4E__SMS_Segment_Count__cNumber(18, 0) Status Pendula4E__Status__cPicklist Queued
Sent To Gateway
Delivered
Failed
Bounced
OpenedTenant Id Pendula4E__Tenant_Id__cText(50) Timestamp Pendula4E__Timestamp__cDate/Time To Number Pendula4E__To_Number__cPhone Triggering Object Name Pendula4E__Triggering_Object_Name__cText Area(255) Triggering Record Id Pendula4E__Triggering_Record_Id__cText Area(255) Message Event
The Message Event object records events related to inbound and outbound Pendula messages.
Field Label Field Name Data Type Values Created By CreatedByIdLookup(User) Error Code Pendula4E__Error_Code__cText Area(255) Error Message Pendula4E__Error_Message__cLong Text Area(32768) Last Modified By LastModifiedByIdLookup(User) Message Pendula4E__Message__cLookup(Message) Message Event Number NameAuto Number Message Id Pendula4E__Message_Id__cText(36) Owner OwnerIdLookup(User,Group) Status Pendula4E__Status__cPicklist Sent To Gateway
Delivered
Failed
Bounced
OpenedTenant Id Pendula4E__Tenant_Id__cText(255) Timestamp Pendula4E__Timestamp__cDate/Time Message Recipient
The Message Recipient object is used to record the association between a Pendula message and the native Salesforce recipient.
Field Label Field Name Data Type Contact Pendula4E__Contact__cLookup(Contact) Created By CreatedByIdLookup(User) Last Modified By LastModifiedByIdLookup(User) Lead Pendula4E__Lead__cLookup(Lead) Message Pendula4E__Message__cMaster-Detail(Message) Message Recipient Number NameAuto Number Person Pendula4E__Person__cLookup(Account) User Pendula4E__User__cLookup(User) How toSetting up the Console messages flow in Pendula
This article outlines how to set up a flow in Pendula to send and receive the 1:1 Console messages that are displayed on the Console component on Salesforce objects.
Pre-requisites
- Pendula for Salesforce integration activated in your Pendula tenant
- The Pendula Salesforce Managed Package installed in your SFDC organisation
- The Console component added to all relevant objects in SFDC
- Pendula Activity Sync activated and sending events from Pendula to Salesforce
Setting up the flow
- Create a new flow in the Experience & Workflow studio and call it 'Console Messages Flow'.
- Add the Salesforce event trigger. Select Console Message as the triggering object, and set the trigger condition as 'When a record is created'. This will trigger the flow when a user sends a 1:1 message (i.e. creates a new Console Message record) from the Pendula Console in Salesforce.
- Add a 'Update record' action next in the flow. Select the Console Message as the record to be updated, and using the merge field explorer, enter the ID field of that object from the trigger node. See this article for how to find and use merge fields in the data explorer.
- The final node in the flow is the Conversation node. Configure the recipient to be the phone number from the Console Message object (
Pendula4E__To_Number__c) and the Console Message body (Pendula4E__Body__c) as a merge field in the Message body field.
- In the 'Replies' tab of the Conversation node, set an 'any-reply' path and delete any other paths.
- The flow should have 3 total nodes. Activate the flow and test by sending a 1:1 message from the Console component in Salesforce.
How toPendula Settings for Salesforce Activity Sync
The Pendula Settings tab controls settings specific to the Pendula Salesforce app.
These settings will be configured by Pendula as part of your onboarding. You shouldn't need to update or change these settings after initial configuration.
Pendula syncs all messages created by flows or through the console to your Salesforce org as message records.
Create message recipient record
When this setting is enabled, Pendula creates message recipient records that match inbound or outbound messages with the email address or phone number associated with the Lead, Contact, User or Person Account that received or initiated the message.
Where email addresses and phone numbers are shared across records, a message recipient record will be created for each matching record.
If you are using Console, messages will appear in each instance of the Console with matching phone numbers. This ensures that an agent using Console on the Lead record sees the same conversation as another agent using Console on the Contact record (for example), so that each agent has the same context of the active conversations with the recipient.
This section lets you choose which records are included in the message recipient matching process (at least one must be selected).
Match all potential Contacts
Matches any Contact that has the email address or mobile phone number associated with this message.
Match all potential Leads
Matches any Lead that has the email address or mobile phone number associated with this message.
Match all potential Users
Matches any User that has the email address or mobile phone number associated with this message.
Match all potential Person Accounts
Matches any Person Account that has the email address or mobile phone number associated with this message.
How toHow to add the Pendula Console component to Salesforce record pages
Console can be added to the pages of any of the record types you selected in Pendula Settings.
The following example shows how to add it to a Contact. The procedure is the same for the other record types.
- From the app launcher, select Contacts.
- Select an individual contact.
- From the setup menu, select Edit Page.
- Add a tab to the page layout in the area where you want to view the Console messages.
- Select Custom as the Tab Label, and enter Pendula Console as the Custom Label.
- Click Done.
- Select the Pendula Console tab and drag the Custom - Managed consoleDisplay component into the tab.
- Click Save.
- Click Activation and set the page to Org Default to apply these changes to all Contacts.
Your Pendula Console is now ready to use.
-
<% categories.forEach(function(category) { %>
<%= partial('partial-article-list-sections', {
id: 'category-' + category.id,
parentId: '#sidebar-navigation',
sections: category.sections,
activeCategoryId: activeCategoryId,
activeSectionId: activeSectionId,
activeArticleId: activeArticleId,
partial: partial
}) %>
<% }); %>
-
<% sections.forEach(function(section) { %>
-
<%= partial('partial-article-list-sections', {
id: 'section-' + section.id,
parentId: '#' + id,
sections: section.sections,
activeCategoryId: activeCategoryId,
activeSectionId: activeSectionId,
activeArticleId: activeArticleId,
partial: partial
}) %>
<% if (section.articles.length) { %>
-
<% section.articles.forEach(function(article) { %>
- <%= article.title %> <% }); %>
<% }); %>