Blog
Read the latest blogs
Find tutorials, guides, and use case examples in the
Learning center
The Write Excel block is used to write data into an Excel file. A user can select a range of header columns and then insert/append data into the Excel file under the selected columns.
When fully expanded, the following is an example of the Write Excel block:
The green input connector in the header is used to trigger the block for executing a task.
The green output connector in the header is active for connecting the next building block in the flow, as necessary.
You can change the block title, Write Excel, by double-clicking it and entering a new title.
A user can choose any of the below options as a source type:
By clicking the Path to File ellipsis button, you will open the file dialog window for navigating to the desired Excel file to write to. You can also navigate to a file on a shared network path. After selecting the path, the file will be shown in the text field.
Note: A user can directly update the file content, as the file is not saved inside of Leapwork. Instead, it is referenced from a path.
Fields entered into the Text fields enable the use of external values (dynamic data) in the Path to File.
To use the value of an added field, right-click in the Path to File text field and select Insert token, then the Add new field 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 Write 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 written. 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 write permissions. If the file is moved or renamed, the connection may fail.
Select the range and sheet inside of the Excel file that you want to write to by clicking on the Range Define button. In the Select Range popup window, select the columns and rows that you'll use:
When selecting the range, check the Use first row as header if you wish to use the first row’s column data for the field names in the block. In this example, the fields would be S. No., First Name, Role and Status.
It’s possible to select data from any sheets in the Excel file but, it’s only possible to select one data range per Write Excel building block.
The Not written green output connector is triggered if the block is not able to write to the Excel file or if the Excel file is not found.
This connector can be used to branch the execution of the flow, depending on whether the Write Excel block is not able to write to the Excel file or if the Excel 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, which can be connected for inserting data via blue connectors.
The data insertion method. Select between:
When using the Row index method, specify which row you want to write data to.
Updated 4.3.25
©2024, Leapwork. All rights reserved.