Microsoft 365 Excel
Description
Section titled “Description”This module allows working with Excel files stored in OneDrive via Microsoft Graph API. Available operations:
- List Excel files: Searches all .xlsx files in user’s OneDrive.
- List sheets: Gets the worksheets of an Excel file.
- Read range: Reads data from a specific range in A1 notation (e.g.: A1:D10). Returns values, text and formulas.
- Read as objects: Reads data using the first row as headers and returns an array of JSON objects, ideal for data processing.
- Write range: Writes data to a range. Accepts 2D arrays, object arrays (automatically converted with headers) or JSON strings.
- Add sheet: Creates a new sheet in the file.
- Delete sheet: Deletes an existing sheet.
- Get used range: Gets the range of cells with data.
- Clear range: Clears content and format from a range.
Configuration
Section titled “Configuration”| Parameter | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Configured Microsoft OAuth account |
| fileId | string | Yes | Excel file ID in OneDrive |
| operation | select | Yes | Operation to perform |
Sub-node Read Range / Read as Objects
Section titled “Sub-node Read Range / Read as Objects”| Parameter | Type | Required | Description |
|---|---|---|---|
| sheetName | string | Yes | Sheet name (default: Sheet1) |
| range | string | Yes | Range in A1 notation (default: A1:Z100) |
| outputKey | string | No | Output key (default: data / rows) |
Sub-node Write Range
Section titled “Sub-node Write Range”| Parameter | Type | Required | Description |
|---|---|---|---|
| sheetName | string | Yes | Sheet name |
| range | string | Yes | Start range where to write (e.g.: A1) |
| valuesKey | string | No | Key in data with values (default: values) |
Sub-node Add Worksheet
Section titled “Sub-node Add Worksheet”| Parameter | Type | Required | Description |
|---|---|---|---|
| sheetName | string | Yes | New sheet name |
Credentials
Section titled “Credentials”Requires Microsoft OAuth2 type credentials with:
- Scopes: Files.ReadWrite, Files.ReadWrite.All
- The module manages token refresh automatically
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": { "rows": [ { "_rowIndex": 2, "Nombre": "Juan", "Email": "juan@test.com", "Total": 150 }, { "_rowIndex": 3, "Nombre": "Maria", "Email": "maria@test.com", "Total": 200 } ] }, "_meta_": { "operation": "readRangeAsObjects", "microsoftService": "excel", "fileId": "abc123" }}Usage Example
Section titled “Usage Example”Basic case - Read data as objects
Section titled “Basic case - Read data as objects”{ "credentials_id": "mi-cuenta-ms365", "fileId": "ABC123DEF456", "operation": "readRangeAsObjects", "sheetName": "Ventas", "range": "A1:E50"}API Used
Section titled “API Used”- Microsoft Graph API - Excel workbook endpoints (
/me/drive/items/{id}/workbook/worksheets)
- When using “Read as objects”, the first row is used as headers
- The
_rowIndexfield in the output indicates the actual row in Excel (starting from 2) - When writing, if an object array is passed, it is automatically converted to tabular format with headers
- The write range is automatically calculated based on data dimensions
- Sheet names with special characters are automatically encoded
Related Nodes
Section titled “Related Nodes”- MS365 OneDrive - Manage files in OneDrive
- MS365 Calendar - Microsoft 365 Calendar
- MS365 Outlook - Email with Outlook