How to
Salesforce event trigger

Georgia White
Georgia White
  • Updated

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 IsChanged trigger conditions. This prevents unwanted triggering of flows and communications when users within Salesforce update records. To support IsChanged flows, 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:

Field types in Salesforce →

Date-specific fields in Salesforce →

To configure a boolean field you must enter true or false into 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/5003000000D8cuI Record ID: 5003000000D8cuI

Lightning Experience example: 

URL: https://na1.lightning.force.com/lightning/r/Case/5003000000D8cuIQAA/view?0.source=alohaHeader

Record ID: 5003000000D8cuIQAA

Using the is null operator

The Get Salesforce records trigger supports the use of the is null operator. The value must be set to true or false, 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:

Field types in Salesforce →

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:

Field types in Salesforce →

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: 

  1. equal to
  2. not equal to
  3. greater than
  4. greater than or equal to
  5. less than
  6. less than or equal to
  7. starts with
  8. ends with
  9. contains
  10. 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 null is a boolean operator and supports true and false values. 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 IsChanged use cases where the field is being edited from nothing to a value, specify is is null equals false on the field being edited.