# Set up your data sources

The Data Sources setting allows you to specify one or more sources for performing SQL queries. You can add multiple data sources during the recipe setup. To modify existing data sources or add new ones after the recipe is active, stop the recipe first, then make your changes.

# How to set up your data sources

Complete the following steps to set up your data sources:

1

Select Add data source to include one or more data sources.

2

Configure the following fields for each data source:

  • Data source name

  • Provide a name for the data source, such as accounts or employees, to reference in the query.

  • Data source type

  • Select the type of data source from which SQL Transformations retrieves data:

3

Select a specific data table from the available list if you chose Data table as the data source type. No additional setup is required after you select the table.

RESERVED CHARACTER USAGE

Avoid using the @ character at the beginning of table and column names in data tables. It is reserved in SQL and can cause errors during query execution.

4

Choose the File format for your data if you select Content stream or FileStorage file as the data source type. Select either CSV or Excel. Based on your selection, additional fields display:

  • Worksheet (Excel files only)

  • Enter the name of the Excel worksheet that contains the data you plan to retrieve.

  • Range (Excel files only)

  • Specify the cell range within the Excel worksheet from which to retrieve data (for example, B5:C20). Ignore the header row when providing the range. If the data range is dynamic, include an arbitrary range and configure the query to ignore empty or null rows.

5

Set the Schema setup type after selecting the file format. This setting determines how to define the schema of your incoming data:

6

Provide additional data sources by selecting Add data source. This allows you to compile the necessary data for the transformation.

# Example data source: CSV file content from AWS S3 connector

In this example the data source is named employee and the data is fetched from file content coming from an S3 download file action. The schema contains employee-related information, and the CSV data uses a , (comma) as the delimiter.

Additionally, the user has chosen to ignore the CSV header row.

Example data source setup 1 Data source example setup 1

# Example data source: CSV file stored in Workato FileStorage

In this example the data source is named zipcode and is fetched from a file stored in Workato FileStorage in the path SQL/zipcode_data.csv.

Similar to the preceding example, the column delimiter is a , (comma), and the user has chosen to ignore the CSV header row of the data from the file while running the query.

Example data source setup 2 Data source example setup 2

# Example data source: Excel file content from Google Drive connector

In this example, the data source is named sales_data. It retrieves data from an Excel file sourced from a Google Drive download file action. The schema is configured with sales-related columns, and the Excel data is obtained from the worksheet named Q1_Sales and the range A3:E100.

Example data source setup 3 Data source example setup 3

# Example data source: Dynamic schema with Salesforce trigger output

This example uses a Salesforce trigger, where the schema updates dynamically through the Object schema datapill in the Salesforce output. Since Salesforce data, like Field name, Field label, and Mapped type, can vary depending on the records returned by the trigger, this recipe sets the Schema setup type to Dynamic.

Data source example setup for Salesforce dynamic schema Data source example setup for Salesforce dynamic schema

The schema automatically adjusts to the fields from the Salesforce output, handling any changes or updates to the object fields without manual intervention.

# Example data source: Dynamic schema with schema from previous query

The following example passes a dynamic schema from one query step to the next. The Output schema datapill from the first query is mapped as the data source in the dynamic schema section of the second query:

Data source example setup passing schema from previous query data Data source example setup passing schema from previous query data

The dynamic schema option is selected because the data structure, such as Field name and Field type, can vary with the records processed earlier. The schema automatically adjusts to match the structure of the previous query’s output without requiring manual configuration.


  1. Set up your query
  2. Configure your output
  3. Output fields

Sample use cases

See our guides for step-by-step instructions on how to leverage SQL Transformations for the following use cases:


Last updated: 9/11/2024, 11:33:55 PM