Blog
Read the latest blogs
Find tutorials, guides and use case examples in the
Learning center
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:
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.
A user can choose any of the below options as a source type:
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.
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.
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.
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.
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.
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.
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:
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.
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.
Once the Excel file is loaded and a range has been selected, the column data for each row is accessible as fields.
The data selection method. Select between:
When using the Row index method, specify which row you want to get data from.
If using the Iterate method, when the iteration is completed, the right green output connector is triggered.
Updated 04.3.25
©2024, Leapwork. All rights reserved.