Returns a rowset with the selected information from Salesforce objects that match the criteria you specify. This function works only with Marketing Cloud Engagement accounts that are integrated with Sales Cloud accounts.

This function returns data in a rowset. Use the Row() and Field() field functions to access individual fields. To prevent long-running functions from impacting email send performance, the resulting rowset is limited to 1,000 rows.

Each use of this function generates a SOAP request to your Salesforce org. The function is subject to the Salesforce API limits for the org.

The RetrieveSalesforceObjects() function has five parameters:

  • objectName (string): Required. The API name of the Salesforce object to retrieve information from.
  • fieldsToRetrieve (string): Required. A comma-separated list of fields to retrieve information from.
  • queryFieldName (string): Required. The name of the field to filter on.
  • queryFieldOperator (string): Required. The operator to use for the filter.
  • queryFieldValue (string): Required. The value to filter on.

You can optionally include additional sets of query names, operators, and values by appending them to the list of parameters. The function uses AND logic to connect multiple query sets.

To call this function, pass it the name of the object to retrieve data from, and the fields that you want to retrieve. You must also pass at least one set of query parameters. A set of query parameters contains the name of the field to query, the operator to use, and the value to match. You can provide multiple sets of query parameters.

The example outputs a list of all leads in the "West" region that have and annual revenue value greater than 1,000,000.