VOOZH about

URL: https://www.cdata.com/kb/tech/excel-odbc-power-automate.rst

⇱ How to Access Live Excel Data in Power Automate Desktop via ODBC


How to Access Live Excel Data in Power Automate Desktop via ODBC

πŸ‘ Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
The CData ODBC Driver for Excel enables you to integrate Excel data into workflows built using Microsoft Power Automate Desktop.

The CData ODBC Driver for Excel enables you to access live Excel data in workflow automation tools like Power Automate. This article shows how to integrate Excel data into a simple workflow, moving Excel data into a CSV file.

Through optimized data processing, CData ODBC Drivers offer unmatched performance for interacting with live Excel data in Microsoft Power Automate. When you issue complex SQL queries from Power Automate to Excel, the driver pushes supported SQL operations, like filters and aggregations, directly to Excel and utilizes the embedded SQL engine to process unsupported operations client-side (e.g. SQL functions and JOIN operations).

Connect to Excel as an ODBC Data Source

If you have not already, first specify connection properties in an ODBC DSN (data source name). This is the last step of the driver installation. You can use the Microsoft ODBC Data Source Administrator to create and configure ODBC DSNs.

Connecting to Local or Cloud-Stored (Box, Google Drive, Amazon S3, SharePoint) Excel Files

CData Drivers let you work with Excel files stored locally and stored in cloud storage services like Box, Amazon S3, Google Drive, or SharePoint, right where they are.

Setting connection properties for local files

Set the URI property to local folder path.

Setting connection properties for files stored in Amazon S3

To connect to Excel file(s) within Amazon S3, set the URI property to the URI of the Bucket and Folder where the intended Excel files exist. In addition, at least set these properties:

  • AWSAccessKey: AWS Access Key (username)
  • AWSSecretKey: AWS Secret Key

Setting connection properties for files stored in Box

To connect to Excel file(s) within Box, set the URI property to the URI of the folder that includes the intended Excel file(s). Use the OAuth authentication method to connect to Box.

Dropbox

To connect to Excel file(s) within Dropbox, set the URI proprerty to the URI of the folder that includes the intended Excel file(s). Use the OAuth authentication method to connect to Dropbox. Either User Account or Service Account can be used to authenticate.

SharePoint Online (SOAP)

To connect to Excel file(s) within SharePoint with SOAP Schema, set the URI proprerty to the URI of the document library that includes the intended Excel file. Set User, Password, and StorageBaseURL.

SharePoint Online REST

To connect to Excel file(s) within SharePoint with REST Schema, set the URI proprerty to the URI of the document library that includes the intended Excel file. StorageBaseURL is optional. If not set, the driver will use the root drive. OAuth is used to authenticate.

Google Drive

To connect to Excel file(s) within Google Drive, set the URI property to the URI of the folder that includes the intended Excel file(s). Use the OAuth authentication method to connect and set InitiateOAuth to GETANDREFRESH.

When you configure the DSN, you may also want to set the Max Rows connection property. This will limit the number of rows returned, which is especially helpful for improving performance when designing workflows.

Integrate Excel Data into Power Automate Workflows

After configuring the DSN for Excel, you are ready to integrate Excel data into your Power Automate workflows. Open Microsoft Power Automate, add a new flow, and name the flow.

πŸ‘ A new flow in Power Automate

In the flow editor, you can add the actions to connect to Excel, query Excel using SQL, and write the query results to a CSV document.

Add an Open SQL Connection Action

Add an "Open SQL connection" action (Actions -> Database) and configure the properties.

  • Connection string: DSN=CData Excel Source

After configuring the action, click Save.

πŸ‘ A configured 'Open SQL connection' action

Add an Execute SQL Statement Action

Add an "Execute SQL statement" action (Actions -> Database) and configure the properties.

  • Get connection by: SQL connection variable
  • SQL connection: %SQLConnection% (the variable from the "Open SQL connection" action above)
  • SQL statement: SELECT * FROM Sheet

After configuring the action, click Save.

πŸ‘ A configured 'Execute SQL statement' action

Add a Write to CSV File Action

Add a "Write to CSV file" action (Actions -> File) and configure the properties.

  • Variable to write to: %QueryResult% (the variable from the "Execute SQL statement" action above)
  • File path: set to a file on disk
  • Configure Advanced settings as needed.

After configuring the action, click Save.

πŸ‘ A configured 'Write to CSV file' action

Add a Close SQL Connection Action

Add a "Close SQL connection" action (Actions -> Database) and configure the properties.

  • SQL Connection: %SQLConnection% (the variable from the "Open SQL connection" action above)

After configuring the action, click Save.

πŸ‘ A configured 'Close SQL connection' action

Save & Run the Flow

Once you have configured all the actions for the flow, click the disk icon to save the flow. Click the play icon to run the flow.

πŸ‘ A fully configured workflow

Now you have a workflow to move Excel data into a CSV file.

πŸ‘ Application data in a CSV file (Salesforce is shown)

With the CData ODBC Driver for Excel, you get live connectivity to Excel data within your Microsoft Power Automate workflows.

Related Power Automate Articles

This article explains how to use the CData ODBC Driver for Excel with Power Automate Desktop. Check out our other articles for more ways to work with Power Automate (Desktop & Online):

Ready to get started?

Download a free trial of the Excel ODBC Driver to get started:

 Download Now

Learn more:

πŸ‘ Microsoft Excel Icon
Excel ODBC Driver

The Excel ODBC Driver is a powerful tool that allows you to connect with live Excel file data, directly from any applications that support ODBC connectivity.

Access Excel Spreadsheet data like you would a database - read, write, and update data through a standard ODBC Driver interface.