Read Excel

The Read Excel block is used to read an Excel file, select a range of data and then use that data to drive an automation case.

See the Drive data with Excel lesson to get an example of how to use the Read Excel block.

When fully expanded, the following is an example of the Read Excel block:
read-excel-cloud-path

The Read Excel block header

The left green input connector in the header is used to trigger the block for executing a task.

The right green output connector in the header is triggered when a row from an Excel file has been read. If Method is set to Iterate, this output connector triggers on each iteration until all rows in the selected range are iterated through.

The block title Read Excel, can be changed by double-clicking on it and typing a new title.

Source Type

A user can choose any of the below options as a source type:

  1. Data File: File for upload will be saved inside of LEAPWORK.read-excel-data-file
  2. Local Path: File for upload will be referred to from a specified path.
    read-excel-local-path
  3. Cloud file: The file will be accessed from SharePoint via a configured connection.
    Note: This feature is available starting from Release 2025.1.173. Currently, this option works only on the local machine and is not applicable to remote or cloud agents.
    read-excel-cloud-path

Select Data File to read

By selecting Data File for uploading, it will open a file dialog so a user can choose which file to upload from a file system. After the file is selected, it will be saved in LEAPWORK.

Note: A user needs to re-upload the file if the file content has been modified.

Path to file

In the Read Excel block, clicking the Path to File option will open a file dialog so a user can choose a path to the file on the file system, which can also be a shared network path. Once selected, the file path will be shown in the text box.

Note: A user can directly update the file content, as the file is not save inside of LEAPWORK. Instead, it is referenced from a path. The range must be defined again in case more rows/columns have been added, otherwise the updated content from a previously defined range will be used.

Text fields

In the Read Excel block, fields enable the use of external values (dynamic data) in the Path to file.

To use the value of an added field, right-click the text field below the Path to file title and select Insert token, then enter the field’s name.

Fields can be renamed by double-clicking on them. The tokens will change their visual appearance accordingly.

Connection

Note: This feature is available starting from Release 2025.1.173
The Connection dropdown lists available configured connections. Currently, the only available option is SharePoint Connection.

A SharePoint connection must be configured in advance to use this parameter. Follow the instructions in the Microsoft Graph connection guide to set up the connection.

Site URL

The Site URL field specifies the SharePoint site where the Excel file is stored. This field must contain a valid SharePoint site URL to ensure the correct file location is accessed.

When selecting Cloud File as the Source Type, this field becomes mandatory and must be filled in before proceeding. The URL entered should correspond to the root site or subsite where the Excel file is located.

Example: https://company.sharepoint.com/sites/FinanceTeam

Note: The URL must be correctly formatted to match the SharePoint environment.

File Name

The File Name field specifies the name of the Excel file that the Read Excel block will access within the selected SharePoint site. This field must include the full name of the file, including its extension (.xls or .xlsx).

Once the Site URL is provided, users must enter the File Name to point to the exact file to be read. The system will automatically locate the file within the SharePoint document library associated with the given URL.

Example: Quarterly_Report.xlsx

Note: The file must exist in the specified SharePoint site and the user must have read permissions. If the file is moved or renamed, the connection may fail.

Range

The range and sheet inside of the Excel file may be selected. Click the field to select the range and sheet in a popup window:

excel-block2

When selecting the range, check the Use first row as header button if you wish to use the first row’s column data in the block as the field name. In this example, the field would be Username, Password, Full name, and Role.

It’s possible to select data from any sheet in the Excel file but it’s only possible to select one data range in a Read Excel building block.

Not read

The right green output connector is triggered if the block is not able to read the excel file or the excel file is not found.

This connector can be used to branch the execution of the flow depending on whether the block is not able to read the excel file or if the file is not found.

Fields (named or columns)

Once the Excel file is loaded and a range has been selected, the column data for each row is accessible as fields.

Method

The data selection method. Select between:

  • First row: Always select the first row in the range.
  • Row index: Select a specific row, such as the 5th row.
  • Iterate: Continue reading all rows in the range. The top connector is triggered for each data row in the selected data range.

Row index

When using the Row index method, specify which row you want to get data from.

Completed

If using the Iterate method, when the iteration is completed, the right green output connector is triggered.

Updated 04.3.25