Use an Advanced Query to Get Records from Salesforce

Use the Advanced Query activity to create a Salesforce query. You can get records with multiple entities and multiple WHERE clauses. You can map the query results from Salesforce to your schema.

To get the records using a custom, advanced query, do the procedure in this topic.

Salesforce Query Advanced Entity Configuration Screen


Good to Know

How to Start

  1. On the Application Explorer screen, do one of these:
  2. Do one of these:
    • Add an activity:
      1. In the Process Builder, in the Activity Library, open the Salesforce Salesforce icon tab.
      2. On the Salesforce Salesforce icon tab, drag the Query Advanced Entity Query Advanced Entity icon activity onto your process.
    • Change an activity:
      1. In your process, double-click your activity.
  3. On the SaleForce Query Entity Configuration screen, click Advanced Query Entity Advanced Query Entity icon.


  1. On the SaleForce Query Entity Configuration screen, in the Salesforce field, select your Salesforce access token.

    To create a new access token, click Add Token Add Token icon. For more information, refer to Access Token for Salesforce.

  2. Complete this field as necessary.
    Field Name Definition


    Specifies the select statement that defines the SQL query the activity does to get records from Salesforce.
    Accepted Values:
    A valid SQL select query.
    Default Value:
    Accepts Process Data Variables:
    SELECT Id, Name FROM Account 
      WHERE Id IN ( SELECT AccountId FROM Contact WHERE LastName LIKE 'apple%' )
      AND Id IN ( SELECT AccountId FROM Opportunity WHERE isClosed = false)
  3. Click Execute Query to display the response of the query in Result Query box.
  4. On the Schema Mapper field, click the Ellipses button.
  5. On the Schema Mapper screen, map the response columns to the schema elements.

Related Topics