Salesforce - Query record

The Salesforce - Query record action A tool for building the processes, logic, and direction within workflows. queries and retrieves records of the specified object in Salesforce, limiting results using conditional statements and sorting results as configured.

For more information about Salesforce, go to Salesforce.

Configure the Salesforce - Query record action

  1. Add the action to the workflow and open the action configuration panel. For more information, see Add an action to the workflow.

  1. Select a Connection. If you do not have a connection, see Add a connection.
  2. Select an Object name.

  3. Enter the Maximum number of records to return.

  4. Select Fields to include in the query value.

  5. Limit the returned query results (add one or more conditions):

    1. In the Condition section, complete the fields below.

      Field

      Description

      When Attribute from the selected object. Accepts a selection from the drop-down list.
      Operator Comparison between When and Value. Accepts a selection from the drop-down list. Selections in the drop-down list correspond to the data type of the entry for When.
      Value The value you are looking for in the attribute specified for When. Accepts either a selection from the drop-down list or an inserted variable. Accepted variable types correspond to the data type of the entry for When.
    2. Click Save condition to save your changes.
    3. To add another condition, click Add condition again.
    4. To configure query behavior for multiple conditions, select all or any.
  6. Sort returned query results:

    • For Sort by, select an attribute.
    • Select a Direction.
    • Select a value for Sort nulls to last.

For more information on all the required and optional configuration fields, go to Salesforce - Query records action fields, buttons, and settings.

Salesforce - Query records action fields, buttons, and settings

Section

Field

Description

Variable types

(unlabeled)

Connection Credentials and other settings required to pass data between the workflow and the indicated service, which could be a cloud service, business application, or content store.

The Salesforce connection to use for accessing the records to query.

(n/a)

 

Object name

The object type of the records you want to query. Accepts a selection from the drop-down list. Options in the drop-down list are derived from the selected Salesforce connection.

(n/a)

  Maximum number of records to return The maximum number of Salesforce records that you want to query. (n/a)
  Fields The Salesforce fields that will be included as part of the object's output.  

Conditions

Add condition

Conditional statements to use for the query. For example, to query for stale items, you might configure a condition "Modified is before <yourDateVariable>."

To configure query behavior for multiple conditions, select all or any.

To add a condition, fill in the fields below.

To edit a condition, click (Edit condition).

To remove a condition, click delete condition (Delete condition).

To add additional conditions, click Add condition.

(varies)

Sorting

Sort by

Attribute to use for sorting. Accepts a selection from the drop-down list. Options in the drop-down list are derived from the selected Salesforce connection.

(n/a)

 

(n/a)

Option to sort in Ascending or Descending direction.

(n/a)

 

Sort nulls to last

Positions records with null (empty) values for the Sort by attribute to the end of the sorted results.

Boolean

Output  

Stores the result of the action as an object with the following variables:

  • Records: Collection of records with the Fields that are selected for the Salesforce object that was selected.

  • First record: First record in the returned collection that is stored as a single object.

  • Record IDs: Collection variable to store the record ID(s) of all the returned records.

  • Number of records returned: Integer variable to store the total number of items retrieved from this query.

(varies)