Submitting Your Query to Salesforce
Overview
Once you are ready to submit your query to Salesforce, add an EXTERNAL API CALL action to your SmartFlow.
Configure the Action
Headers
Add an Authorization Header. The value of this header should include the term Bearer as well as the Access Token received in Action #4 (Bearer $EXTCALL_4.access_token).
Basic Auth
- UserName: Leave blank; the access token takes care of this for you
- Password: Leave blank; the access token takes care of this for you
- Method: Set this to POST
- Timeout: The default is ten (10) seconds; this should work for your instance
- URL of Service: Set this to the URL of your Salesforce instance. https://.my.salesforce.com/services/data/v39.0/parameterizedSearch/
- Body: For this query, we use a parameterized search query. The following provides you with the Name, ID, Account ID, and Mobile Phone Number of the contact
Parameters
q: The string you want to search for. We set this to the variable with our country code stripped out: $phoneNumber
fields: The fields you want to have returned. We chose to return the ID for the contact, their Account ID, their full name, Phone Number, and Mobile Phone Number. Check with your Salesforce Administrator for a complete list of available fields.
sobjects: The Salesforce object you want to search. We choose the CONTACTS object for this query
For more information on Parameterized Queries and how to use them, see Salesforce Parameterized Search documentation.
To access these values, you need to set your response variable to capture the data you desire. For our example, we want the following name /value pairs:
Variable | Maps To |
---|---|
Name | searchRecords[0].Name |
Id | searchRecords[0].Id |
AccountId | searchRecords[0].AccountId |
MobileNumber | searchRecords[0].MobilePhone |
Phone | searchRecords[0].Phone |
searchRecords[0].Email |
Building Your Flow
Your flow now returns the values within system variables. Their names follow this format: $. (eg. $EXTCALL_5.Name, $EXTCALL_5.Id). You can now reference this during the remainder of your flow.