--- title: "Using SOQL With Salesforce" slug: "using-soql-with-salesforce" description: "Learn how to use advanced Salesforce steps to run SOQL queries, access custom data types, and return query results as JSON for use in a Flow." updated: 2026-06-04T20:05:52Z published: 2026-06-04T20:05:52Z canonical: "documentation.decisions.com/using-soql-with-salesforce" --- > ## 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/version-10/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/image-1779989710611.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/image-1779989742272.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.V![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1779989811516.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/image-1779989905703.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/image-1779989957507.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/image-1779990044833.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/image-1779990216780.png) 8. Under the INPUTS category, select **Unknown** next to the **String to Deserialize** field and click **Flow Data**. Select **Run SOQLQuery Get Json_ Output** and click DONE.![](https://cdn.document360.io/6ef8bcc1-6489-4486-9ad1-83acff7e5df0/Images/Documentation/image-1779990259920.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/image-1779990393566.png) ## Debug 1. On the top action bar, click **Debug**. Then, click START DEBUGGING. 2. Select the JSON Deserialize step to view the Input/Output Data.