Query
Learn more about querying in a workflow automation
Introduction
A query allows you to select a source target based on specific criteria. You can associate a segment code with the query results and insert additional data into it. By customizing the search parameters, you can obtain query results tailored to your criteria for work items. A query consists of various conditions that define your search, bringing results in line with the set parameters.
Query Creation Process
Example Query: Get Salesforce Accounts and print using Debug.
Configure the Flow: Drag and drop a Flow action. Click Configure and provide a description for the flow (for example, Get SF Accounts Information).

Click Save.
Configure the Query: Drag and drop a Query action. Click Configure, select the Source as Salesforce, and Object as Account.

In the Configure Query section, either click All fields or specific Salesforce fields, as needed. For this process, click All Fields.
Preview the Results: Click Preview from the Configure Query section. The Salesforce records will be displayed as Rows in the Result section.
Save the query action. To understand about Where and Related Objects, refer to the Additional Information section below.
Debug the Query: Drag and drop a Debug action. Click Configure and define the variable.

Click the fx icon to access the schema, then drag and drop the name schema onto the debug panel. Select the correct Name field to display the Salesforce account names.
PRO TIP
When using the Debug action, ensure you select the correct field schema to avoid confusion and ensure accurate data output.
Run the Integration:
Click the Close icon and Save.

Click Run
to execute the integration.The console will display the executed query and print the Salesforce Account Names.

Additional Information
Where and Related Table/Object fields are used to refine and manage how data is retrieved from a data source.
Where allows you to specify the conditions or filters for your query. By using Where, you can limit the results to only those that meet certain criteria. For example, if you want to pull records where the status is active, use Where field to define that condition.
Related Table/Object refers to the ability to include data from related entities or objects in your query. For example, if you're querying an Account object, and you need to pull data from related objects, like Contacts associated with that account, use Related Table/Object to get comprehensive datasets that reflect relationships between different data elements.
1. Can I use multiple conditions in a single query?
Yes, you can create queries with various conditions to customize your search parameters and obtain results based on specific criteria.
2. How do I preview the results of a query before executing it?
Click the 'Preview' option in the 'Configure Query' section to display all relevant objects in the results section before executing the query.
3. What are the benefits of using queries in workflows?
Queries allow users to select targets based on criteria, customize search parameters, and associate segment codes with query results, enabling efficient data management and workflow automation.
4. What are the different data sources I can query from?
You can query from various data sources, including Salesforce and other JDBC-compliant databases like MySQL, Oracle, and DB2.
5. Can I combine data from multiple objects or tables in a single query?
Yes, you can combine data from multiple objects/ tables in a single query in DBSync Cloud Workflow, but it depends on the source system and the query type you’re using.
Related Content
Log Management - This section explains how to manage and view logs in DBSync, helping you troubleshoot and monitor integration processes.
Transformation Examples - This page offers examples of how to use query transformations in your integration projects within DBSync.
Last updated