Search

Execute SOQL

Last Updated: Mar 8, 2023

Articles

Use this function to execute a given SOQL(Salesforce Object Query Language) query and fetch the result.

Syntax

Execute SOQL (token, username, password, SOQL)

Parameters

Input Parameter Name Description
token Token used to connect to particular Salesforce account
username Salesforce account username
password Salesforce account password
SOQL SOQL query to be executed

To know more about token, click here.

Returns

Return Value Description
Output
  • On Success returns 1 | Query result
  • On Failure returns 0 | Error Message

Sample

Execute SOQL (ABCDCEF, john@gmail.com, pass@123, SELECT Id FROM Records)

  • Uses token ABCDCEF to connect to Salesforce with username john@gmail.com and password pass@123, executes the SOQL query SELECT Id FROM Records.
    Returns Query result on executing the query.

To view all the Salesforce functions, click here.

Did you find what you were looking for?