Get Range
Gets data from a specific range of an Excel file.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If ContinueOnError property is true, no error is caught when the project is executed even if Catch node is used.
Input
- Excel File Descriptor - The descriptor of the opened excel file. This ID is generated by the Open Excel or the Create Excel node.
- From Cell - The starting cell reference for data retrieval. (e.g.
A1). - To Cell - The ending cell reference for data retrieval. (e.g.
H10).
Output
- Range - The specified range of data from the excel file read in data table format.
Options
- Target - Selects either a specific range or all ranges for the operation.
- Headers - Determines whether or not headers are included.
- Jsonify - Transforms the header names into a JSON-friendly format by converting them to lowercase and replacing spaces with underscores.
info
If the Target property is set to "specific-range", the From Cell and/or To Cell properties need to be set. If the Target property is set to "all-range", the From Cell and To Cell properties can be left empty. The Headers property determines whether or not to retrieve the headers. The Jsonify property converts the retrieved data into JSON format.
How It Works
- Validates Input: Checks that file descriptor is provided
- Verifies Cells: If specific-range, validates From Cell and To Cell references
- Retrieves Handle: Gets the Excel file handle from the descriptor
- Determines Range: Based on target option:
- all-range: Reads all data from the active sheet
- specific-range: Reads only the specified cell range
- Reads Rows: Retrieves all rows from the sheet or specified range
- Processes Headers: If Headers is true, uses first row as column names; otherwise uses column letters (A, B, C...)
- Builds Data Table: Constructs a data table structure with columns and rows
- Applies Jsonify: If enabled, converts header names to lowercase and replaces spaces with underscores
- Returns Data: Outputs the data in data table format
Requirements
- The Excel file must be opened with Open Excel or created with Create Excel
- For specific-range target, valid cell references must be provided
- The active sheet must contain data
- Cell references must be in valid Excel format (e.g., A1, B5, Z100)
Error Handling
| Error Code | Description | Solution |
|---|---|---|
| Core.Excel.GetRange.ErrOnCreate | Configuration parsing failed | Check node configuration is valid |
| Core.Excel.GetRange.ErrOnMessage | Message parsing failed | Verify input message format |
| Core.Excel.GetRange.ErrFileDescriptor | File descriptor is empty or file not found | Ensure file is opened/created before getting range |
| Core.Excel.GetRange.ErrInvalidCell | Invalid cell reference for From Cell or To Cell | Provide valid cell references (e.g., A1, B5) |
| Core.Excel.GetRange.ErrEmptySheet | Sheet has no rows | Verify sheet contains data |
| Excel.GetRange.RowsValues | Row values out of bounds | Check that specified rows exist in the sheet |
| Excel.GetRange.GetExcelHandle | From/To Column or Row is empty or invalid | Provide valid range parameters |
Usage Examples
Example 1: Get All Data from Sheet
Read entire sheet contents:
- Open Excel (data.xlsx) -> fileDesc
- Get Range:
- Excel File Descriptor: fileDesc
- Target: all-range
- Headers: true
- Jsonify: false
-> allData
- For each row in {{allData}}:
- Log (row)
- Close Excel (fileDesc)
Example 2: Get Specific Range
Read a specific cell range:
- Open Excel (report.xlsx) -> fileDesc
- Get Range:
- Excel File Descriptor: fileDesc
- From Cell: "A1"
- To Cell: "E10"
- Target: specific-range
- Headers: true
-> rangeData
- Close Excel (fileDesc)
Example 3: Get Range with Jsonified Headers
Read data with JSON-friendly column names:
- Open Excel (sales.xlsx) -> fileDesc
- Get Range:
- Excel File Descriptor: fileDesc
- From Cell: "A1"
- To Cell: "F100"
- Target: specific-range
- Headers: true
- Jsonify: true
-> salesData
- // Headers like "First Name" become "first_name"
- HTTP Request (POST, API endpoint, {{salesData}})
- Close Excel (fileDesc)
Example 4: Get Data Without Headers
Read range using column letters as headers:
- Open Excel (data.xlsx) -> fileDesc
- Get Range:
- Excel File Descriptor: fileDesc
- From Cell: "B5"
- To Cell: "D20"
- Target: specific-range
- Headers: false
-> rawData
- // Column names will be B, C, D
- Close Excel (fileDesc)
Usage Notes
- The data is returned as a data table object with Columns and Rows properties
- When Headers is true, the first row is used as column names and excluded from data rows
- When Headers is false, columns are named with their Excel letters (A, B, C, etc.)
- Jsonify option is useful for preparing data for API calls or JSON processing
- The all-range target reads from A1 to the last cell with data
- Empty cells in the range are included as empty strings in the result
- The node returns an empty table if the sheet has no data
- Cell values are returned as strings by default (use Raw Value option for numbers)
Tips
- Use Headers: true when your Excel sheet has a header row for cleaner data processing
- Enable Jsonify when sending data to APIs that expect JSON-formatted property names
- Use specific-range to read only the data you need for better performance
- Leave From Cell empty to start from A1, leave To Cell empty to read until last cell
- For large datasets, consider reading in smaller ranges and processing in batches
- The data table format integrates seamlessly with For Each loops
- Use all-range for dynamic sheets where the data size varies
- Combine with Set Range to copy data between files or sheets
Related Nodes
- Set Range - Write data to a range
- Get Cell Value - Read a single cell
- Get Row - Read an entire row
- Get Column - Read an entire column
- Open Excel - Open file before reading
- Switch To Sheet - Change active sheet before reading