---
title: "Using SOQL With Salesforce"
slug: "using-soql-with-salesforce"
updated: 2025-06-25T15:08:50Z
published: 2025-06-25T15:08:50Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.decisions.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using SOQL With Salesforce

## Overview

The steps provided in the Salesforce Module do not accommodate all Salesforce data types or custom data types introduced by a company into a Salesforce environment. These types can be found using the SOAP version of the API or the Advanced Salesforce steps in the Toolbox. Salesforce uses a SQL-like query language called SOQL to query objects. There are two steps that allow a user to run queries of objects.

- **Run SOQLQuery** - this step allows a user to run a query that does not necessarily return data.
- **Run SOQLQuery Get Json** - runs a query and gives the user a result in JSON that can be manipulated using steps under **Data > JSON** in the Flow.

PrerequisitiesBefore using the Salesforce Module, the following requirements must be met:

- Existing Salesforce Account.
- Access to Salesforce API.
- Installation and set up of Salesforce Module in Decisions. To learn how to install a module, see [Installing Modules](/v7/docs/installing-modules-decisions).

The default Salesforce API version is v32.0.

### SOQL

To learn more about SOQL or to refine queries, login to Salesforce and use the Developer Console. This is the best environment for tuning the queries needed to make a Flow work with Salesforce. This allows a user to be able to paste these queries into Flow steps and substitute the variables to make them dynamic.

![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1617737045308.png)

## Example

The following example will demonstrate how to run a SOQL Query that returns JSON data and deserializes the data.

The example below uses a user-defined JSON Type as a parameter. To learn more about creating a JSON Type, see [Create Types From JSON Schema](https://documentation.decisions.com/v9/docs/creating-types-json-schema).

1. In a Designer Project, click CREATE FLOW on the **Global Action Bar**. Name the Flow and click CREATE FLOW.
2. Click the **Done**path on the **Start**step and navigate to **Integrations > Salesforce > Advanced**. Select the **Run SOQL Query Get Json** step and click ADD.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-25_10h55_42.png)
3. Under the INPUTS category on the **Properties**panel, select **Unknown**next to **Soql Query** field and click **Merge Plain Text**. Click SHOW EDITOR.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-25_10h56_17.png)If using a value with escape characters, use the Get SOQL Escaped String step before a Run SOQL Query step to format the value and input it into the SOQL Query through the Merge Text Editor.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-25_10h58_08.png)
4. In the **Merge Text Editor**window, enter a SOQL query to use. After inputting the query, click SAVE to close the window.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-25_10h58_31.png)
5. Select Unknown next to **Token Id**and select **Constant**. Click the dropdown list and select the appropriate token.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-25_10h59_03.png)
6. Click the Done path and navigate to **All Steps [Catalog] > Data > JSON**. Select the**Json Deserialize** step and click ADD.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-25_10h59_52.png)
7. Under PARAMETERS, click the dropdown under **JSON Type** and select an appropriate JSON Type.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-25_11h02_53.png)
8. Under the INPUTS category, select **Unknown**next to the **String to Deserialize** field and click **Select From Flow**. Select **Run SOQLQuery Get Json_ Output** and click DONE.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-25_11h03_32.png)
9. Connect the **Done**and **Error**path to the **End**step. Click **Save**to save changes.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2025-06-25_11h07_26.png)

## Debug

1. On the top action bar, click **Debug**. Then, click START DEBUGGING.
2. Select the Json Deserialize step, select **Execution 1**, and click **View Input/Output Data**.  
![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/2024-08-01_11h49_12.png)
