Skip to main content
Skip table of contents

Adding Additional Data Using SOQL Queries

Besides adding data from related data of the main object, it is also possible to add additional data that is not related. Usually, it is used to retrieve additional data to compliment a workflow, for example. In many cases, working with related lists and possibly with SOQL Query is a big part of generating a document in Dynamo. This section will provide more detailed instructions on how to work with SOQL Query to fetch and display the wanted data.

Adding a new query

Adding a new query starts from the Data tab on the right pane. In the Queries section of the 'Data Source', click on the plus icon (+) next to the Queries heading. From the New Query box:

  1. Enter a name for the variable that holds the query results (var)

  2. The select attribute is where you enter the SOQL statement to retrieve the needed data. Open the Query Editor by pressing on the 3 dots icon.

 

image-20240122-150402.png

New Query window appears after clicking on (plus) in Queries

Introducing the Query Editor

The Query Editor contains:

  1. Salesforce objects & fields: List of Salesforce Objects, Related Objects and fields available in the organization

  2. Selected fields: List of fields will be used in the query

  3. Query: The SOQL syntax

  4. Test Query: The result when you click Test Query button

image-20240122-150556.png

Query Editor UI

Selecting Salesforce objects and fields

Select the Objects you want to query data in Salesforce objects & fields section to see a list of fields in the object.

Look up fields to related objects are included and indicated with an arrow. Select the preferred field to open the related object

Select the arrow next to object's name to navigate to the previous object

image-20240122-150914.png

When fields are selected, the field API name will be populated to the Selected Fields section

image-20240122-150945.png

Completing the SOQL syntax and testing query

When fields are selected, the SOQL Syntax is also populated

image-20240122-151018.png

Complete the SOQL syntax with WHERE, ORDER BY or other query options to gather the data you need. You can use dynamic content taken from the template as the conditions.  See examples in Sample Query Library

Click Test Query to revise the result

If the dynamic data are usede as the condition in the syntax, the Test Query will prompt error but it doesn't affect to the final result.

Editing an existing query

After a query is added, its name (var value) will be shown in the Queries list under Data Source on the right pane. If you would want to edit an existing query (for example to add more fields or conditions), navigate to the query name in the list and click on the location icon.

image-20240122-151334.png

It will direct to the Workflow UI, where the template logic is located. The chosen query is highlighted in light blue and can be edited on the right pane.

image-20240122-151511.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.