Salesforce Execute SOQL action

To search your Salesforce data for specific information, run the Salesforce Object Query Language (SOQL) command from Automation 360 by using the Salesforce Execute SOQL action.

SOQL is similar to Structured Query Language (SQL) but is tailored for Salesforce data. For more information about SOQL, see Salesforce Execute SOQL.

To get specific information from Salesforce data, execute a query from Automation 360.

To send an SOQL query to Salesforce by using the Execute SOQL action, perform the following steps:
Note: Ensure that you are authenticated before calling any Salesforce action. For more information about authentication, see Salesforce Authentication action.

Procedure

  1. From the Actions pane, select Salesforce > Execute SOQL and place it in the canvas.
    Salesforce Execute SOQL action
  2. Enter the following fields:
    1. Enter the SOQL query to execute, for example, Select Status From Case Where Id = '5004W000026rD4HQAU'.
      Note: For Salesforce Custom objects, ensure that you provide the API name instead of the Display name of the object. For example, provide API name: AAIRPA__Salesforce_Connection__c and not the display name: Salesforce Connection " For more information on how to find the API name, see https://help.salesforce.com/s/articleView?id=000327123&type=1.
    2. Select one of the following options:
      • If you want to include the deleted records, select Yes.
      • If you do not want to include the deleted records, select No.
    3. Enter Default as the session name.
    4. Save the outcome to a variable. For example, all the fields of the records can be stored in a list (List_SOQL)
  3. Verify that you can run the bot in Debug mode with a breakpoint set to an action next to Execute SOQL. For example, in the sample provided previously, there is a Message box action. Open the List_SOQL variable to view the results.
    Salesforce verify Execute SOQL action
    The entire result set is returned as a response of the Salesforce Execute SOQL action and there is no limitation to the number of records returned.
    Note: The response can have a high volume of data which might potentially degrade the performance of your automation.
    Note: The output is retrieved as a list of type Dictionary. To read an individual record (row) in this list, you need to loop through all the dictionary items using the Loop action and read or extract the records (rows) individually. For example, the output of get multiple records is saved in the variable list_of_records_any. If the variable contains five records, then each record is passed to the Loop action to be processed one at a time.Loop action for get multiple records