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


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.
When used in this context, the SOQL query will be executed successfully and as expected.
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 flowflow - A flow represents the full lifecycle of a call. It is a road map to how calls will be handled from the moment they enter the phone system to the end of the call. 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
Updated a day ago