Export SQL Table to CSV Using Flow

appRules features an unmatched number of options for migrating, replicating and synchronizing data.

Product & Hosting Options

Platform Product Availability

The workflow activities and other modules used in this sample project are available in the following appRules Platform products:

Platform ProductAvailability

appRules Data Migration Engine

appRules Integration & Automation Engine

appRules Enterprise 360

Hosting & Execution Environment

If you are running the On-Premise, Azure Marketplace or AWS Marketplace editions, the following hosting options supported by appRules are recommended for running this sample project:

Hosting OptionRecommended for Project


appRules Host Service

appRules Desktop

Since the appRules Host Service is automatically installed and ready to go, it is recommended that you use it for evaluating this sample project. Just point your browser to the appRules URL

The completed project is available in the appRules Samples project database. Click the "Open" toolbar button on the appRules home page to select the "Export SQL Tables to CSV Using Flow" project.

This sample project has been configured to show how to use a regular flow to export records from a SQL database to a delimited file (CSV)

Note that this approach can also be used to export records from other data sources such as Salesforce, Dynamics 365, etc.

For this project, you must add the BaseData module to the toolbox. The BaseData module is used for generically accessing data sources. The same activities can be accessed from their specific modules. For example, the SQL initialization/access activities in this sample project can be accessed from the EmbeddedDB module and the CSV initialization/access activities can be accessed from the DelimitedFile module.


1. InitializeSource – Initialize SQL Source

This activity initializes the SQL source. Check out the properties of this activity to see how you select fields, define filters etc. for reading the data from a data source.

2. InitializeTargetFile – Initialize CSV Target File

This activity initializes the CSV target file. Check out the properties of this activity to see how you select fields etc. for saving data into a csv file.

Note that if the full path name is not specified as the file is created in the appRules Shared Files folder in the ProgramData directory

3. While Activity

This While activity has been configured for iterating the records in the SQL source

  • MapAndSetFields

This activity maps and sets the CSV record field values.

  • WriteDelimitedRecord

This activity writes a record in the delimited file.

  • GetNextRecord

This activity reads the next record from the SQL data source

4. CloseSource

This activity closes the SQL source and releases resources. Note: This is also done automatically if the CloseSource activity was not included.

5. CloseTarget

This activity closes the CSV file and releases resources. Note: This is also done automatically if the CloseTarget activity was not included.

Last updated