The QUERY action searches Salesforce records using a Salesforce Object Query Language (SOQL) query.
Use this action when a process needs to find one or more Salesforce records that match specific criteria. Unlike GET, which retrieves a single record by its ID, the Query action allows you to search for records based on field values, relationships, and filter conditions. The action executes a SOQL query against Salesforce. SOQL is Salesforce's query language and is similar to SQL. A query specifies: the fields to retrieve, the Salesforce object to search, and optional filtering criteria. Salesforce executes the query and returns the matching records. The results returned by Salesforce can be mapped to process variables and used in process logic, forms, integrations, and reporting workflows.
The QUERY action is used by the Salesforce connector to query a Salesforce object.
The input parameters of the action are:
| Parameter | Type | Required | Description |
|---|---|---|---|
| salesforceQuery | String | Required |
The SOQL query to execute against Salesforce. For example: SELECT Id, Name FROM Account WHERE Industry = 'Technology' This query retrieves the ID and Name fields for Account records where the Industry field is set to Technology. |
The output parameters of the action are:
| Parameter | Type | Required | Description |
|---|---|---|---|
| salesforceResult | String | Optional | The records returned by the Salesforce query. The structure and contents depend on the query being executed. |
| salesforceStatus | String | Optional | The HTTP status code returned by Salesforce. Use this value to determine whether the query completed successfully. |