SALESFORCE SOQL query function

The SALESFORCE SOQL query function in RPA.

Help CentreFunctions & Formulas

This article describes the RPA Salesforce connector function to execute a SOQL query.

For a full list of available functions, please read SALESFORCE functions.


Description

The SOQL query function executes a Salesforce Object Query Language (SOQL) query and returns the results with auto-pagination. Use this to retrieve records from any Salesforce object with filtering, sorting, and field selection.


Setting it up

{{popups:rpas/add:action=salesforce-query}}

Once on a process map:

  1. Navigate to the process where you would like to add the function
  2. Click on the green button’s drop-down (right side of the green button labelled “Process”)
  3. On the menu that appears, click on the “+ Activity” item
  4. From here you can select the SALESFORCE SOQL query option
  5. Click "Add" once you are done

Input parameters

ParameterRequiredTypeDefaultDescription
ConnectorYesSelect-Select the Salesforce connector to use
SOQLYesTextarea-SOQL query string (e.g. SELECT Id, Name FROM Account WHERE Industry = 'Technology')
VariableYesText-Variable to store the query results

Output variables

VariableTypeDescription
VariableArrayArray of records matching the query, auto-paginated

Errors

  • MALFORMED_QUERY – the SOQL syntax is invalid
  • INVALID_FIELD – a field name in the query does not exist on the sObject
  • Authentication failed – the connector token has expired

Tips

  • Use variables in the query: SELECT Id FROM Contact WHERE Email = '{email}'
  • Results are auto-paginated – all matching records are returned
  • Use LIMIT and OFFSET for manual pagination if needed
  • Access fields via {variable.0.Name}, {variable.0.Id}, etc.

Related functions

  • SOSL search – Full-text search across multiple objects
  • Get record – Get a single record by ID
  • Describe sObject – Get field metadata for a query

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.