Salesforce Data Dip

Note: The Salesforce Data Dip Studio component is currently using the Salesforce API version 45.

If you are using Talkdesk for Salesforce, you can search for specific information in Salesforce with Salesforce Object Query Language (SOQL).

892

Example:

To retrieve the most recently modified opportunity for a contact (owner email, stage and account name), use the query below.

Bear in mind that in this example, the escape tag is being used because we intend to retrieve a name containing an apostrophe (e.g. O’Conner).

The purpose of using this tag is to deal with the single quote character and to ensure that names with single quotes do not break the SOQL query.

The SOQL query will be executed successfully and as expected when used in this context.

SELECT ID, StageName, Account.Name FROM Opportunity WHERE AccountId IN
(SELECT AccountId FROM Contact WHERE Name ='<escape>%{current_flow.contact_name}</escape>') ORDER BY LastModifiedDate
DESC

On the other hand, if a SOQL query is defined in a given Salesforce step using a “contact_name” variable in which the name contains an apostrophe and the escape tag is not used, as shown in the example below, there will be an upstream error and your Studio flow might not work properly.

SELECT ID, StageName, Account.Name FROM Opportunity WHERE AccountId IN
(SELECT AccountId FROM Contact WHERE Name ='%{current_flow.contact_name}') ORDER BY LastModifiedDate
DESC

Additional Resources: