Use List Worksheets to retrieve the worksheets in an existing .xlsx workbook in OneDrive for Business or a SharePoint document library. The step can return every worksheet or only visible worksheets and exposes the result as a typed collection for following and nested steps.
Step Library: Microsoft Excel > Worksheet management
When to use this step
Use this step when you want to:
- retrieve worksheet IDs, names, positions, and visibility from an existing workbook;
- choose whether hidden and very hidden worksheets are included; or
- process the returned worksheets in a following step or a loop.
Common examples include:
- building an inventory of the worksheets in a reporting workbook;
- processing only the visible worksheets in an uploaded workbook; or
- finding worksheet references before another Microsoft Excel operation.
Use Create Worksheet when you want to add a worksheet. Use a worksheet-specific step, such as Rename Worksheet or Delete Worksheet, when you already know which worksheet to change.
Before you begin
- Create or select a Microsoft Excel connection that uses a Microsoft work or school account. The connection requires delegated
Files.ReadWritepermission. - Ensure the connected account can access the target
.xlsxworkbook. - If you use a Microsoft Excel Workbook Object, make it available as a workflow variable or as the Workbook output of an earlier step.
Configure the step
- Add List Worksheets from Microsoft Excel > Worksheet management.
- Select the step to open its configuration panel.
- Select the Microsoft Excel Connection.
- In Workbook source, select Microsoft 365 file, Workbook variable, or Drive and item IDs, then configure the displayed workbook settings.
- Keep Include hidden worksheets enabled to return every worksheet, or disable it to return only visible worksheets.
- Save or publish the workflow.
Settings
| Setting | Required | Accepted values | Visible when | Description |
|---|---|---|---|---|
| Connection | Yes | Microsoft Excel connection | Always | Connection used to access Microsoft Graph. There is no default. The connection must be available to the workflow, remain authorized, and have access to the workbook. |
| Workbook source | Yes |
Microsoft 365 file, Workbook variable, or Drive and item IDs
|
Always | Selects how the workbook is identified. The default is Microsoft 365 file. |
| Workbook file | Yes | Selected .xlsx file or an Object variable with schema @microsoft/drive-item-reference@v1
|
Workbook source = Microsoft 365 file |
Supplies the workbook's drive and item identity. There is no default file. At runtime, the selected value or variable must resolve to an accessible .xlsx file. |
| Workbook variable | Yes | Object variable or step output with schema microsoft-excel/workbook@1
|
Workbook source = Workbook variable |
Supplies a workbook reference published by a previous Microsoft Excel step or stored in a compatible Object variable. There is no default. Text variables are not accepted. The resolved Object must contain non-empty Drive ID and Item ID values. |
| Drive ID | Yes | Fixed Text or Text variable | Workbook source = Drive and item IDs |
Identifies the OneDrive for Business or SharePoint drive. There is no default. The resolved value must not be empty. |
| Item ID | Yes | Fixed Text or Text variable | Workbook source = Drive and item IDs |
Identifies the .xlsx workbook within the selected drive. There is no default. The resolved value must not be empty. |
| Include hidden worksheets | Yes | Fixed Boolean or Boolean variable | Always | Controls which worksheets are published in Worksheets. The default is true, which includes Visible, Hidden, and VeryHidden worksheets. When false, only worksheets whose Visibility is Visible are published. |
Data and outputs
Workflow variable effects
This step does not modify workflow variables.
Step outputs
| Step output | Type | Available when | Scope | Description |
|---|---|---|---|---|
| Worksheets | Collection of Objects — Microsoft Excel Worksheet (microsoft-excel/worksheet@1) |
After successful completion | Following and nested steps in the current workflow context until the execution path ends | Worksheets returned in workbook order after applying Include hidden worksheets. The collection is empty when Microsoft Graph returns no worksheets. No output is exposed when workbook access, provider-response validation, or the step itself fails. |
| Workbook | Object — Microsoft Excel Workbook (microsoft-excel/workbook@1) |
After successful completion | Following and nested steps in the current workflow context until the execution path ends | Reusable reference to the resolved workbook. It always contains Drive ID and Item ID; Name and Web URL are included when the selected input provides them. It is not exposed when the step fails. |
Worksheet object
| Property | Type | Description |
|---|---|---|
| ID | Text | Stable worksheet ID returned by Microsoft Graph. |
| Name | Text | Worksheet name returned by Microsoft Graph. |
| Position | Number | One-based position of the worksheet in the workbook. |
| Visibility | Text | Exact worksheet visibility: Visible, Hidden, or VeryHidden. |
| Is Visible | Boolean | Convenience value that is true only when Visibility is Visible; it is false for Hidden and VeryHidden. |
Runtime behavior
Execution and completion
When the step runs, Flowifier:
- Resolves the selected connection, workbook reference, and Include hidden worksheets, including any referenced variables.
- Validates the resolved values and opens a persistent Microsoft Excel workbook session.
- Retrieves every page of worksheets from Microsoft Graph.
- Normalizes each worksheet, converts its zero-based provider position to the one-based Position, and sorts the collection in workbook order.
- Keeps every worksheet when Include hidden worksheets is
true, or removesHiddenandVeryHiddenworksheets when it isfalse. - Exposes Worksheets and completes the step. The workbook session is closed on a best-effort basis.
The step reads the workbook without modifying it. Repeated or concurrent executions create independent step outputs and do not add, remove, rename, hide, or otherwise change worksheets.
Branches and child steps
This step does not have branches or child steps.
The Worksheets output is available to following steps and to nested steps in a following container, such as For Each Item. A loop over the collection exposes the current Microsoft Excel Worksheet Object, including Visibility and the Boolean Is Visible, for that iteration.
Failure, retry and resume behavior
This step does not suspend execution and has no resume point. Safe Microsoft Graph session and read requests automatically retry HTTP 429 and 5xx responses up to three times after the initial request and honor supported bounded Retry-After values. If all attempts fail, the step fails without exposing Worksheets.
Validation, authentication, permission, missing-resource, provider, or response-validation failures stop the step and prevent the workflow from continuing along its normal execution path. Because all pages must be retrieved and validated before the output is published, a partial provider result is not exposed as a successful collection. A best-effort session-close failure does not replace the primary step result.
The step has no provider mutation to roll back after cancellation or termination. It does not resume an interrupted read; start a new execution when the workflow should try again.
Errors and limits
| Situation | Result | Resolution |
|---|---|---|
| A required fixed setting is missing | Designer validation reports the affected setting and prevents a valid publish. | Complete Connection and the settings shown for the selected Workbook source. |
| A variable is missing, has the wrong type or Object schema, or resolves to an empty or invalid value | The Designer rejects incompatible variables, or the step fails before publishing Worksheets when a referenced value is invalid. | Use a Text variable for IDs, a Boolean variable for Include hidden worksheets, and a compatible Microsoft Excel Workbook Object when required. |
The configured workbook does not exist, is inaccessible, or is not a supported .xlsx workbook |
The step fails and does not expose Worksheets. | Select an accessible .xlsx workbook, or correct Drive ID and Item ID. |
| The connection is unavailable, expired, or lacks permission | The step fails without exposing connection credentials or provider details. | Reconnect Microsoft Excel, grant the required permission, confirm workflow access to the connection, and verify access to the workbook. |
| Microsoft Graph throttles the request or returns a transient server error beyond the retry limit | The step fails after the safe-read retry attempts and does not expose Worksheets. | Wait if necessary and start a new execution. Repeating the read does not modify the workbook or create duplicates. |
| Microsoft Graph returns an invalid or incomplete worksheet response | Provider-response validation fails, the step fails, and no partial collection is exposed. | Verify that the file is a supported .xlsx workbook. If the problem continues, reconnect and retry or contact support. |
| Microsoft Graph returns no worksheets | The step succeeds and exposes an empty Worksheets collection. | No recovery is required. A normal Excel workbook contains at least one worksheet, so verify the workbook if this result is unexpected. |
The step has no configurable item limit. It retrieves all provider pages before publishing Worksheets. General workflow and Microsoft Graph service limits still apply.
Example
Process the visible worksheets in a reporting workbook
Goal: Retrieve only visible worksheets and process each returned worksheet in a loop.
Configuration:
-
Connection:
Finance Microsoft Excel -
Workbook source:
Microsoft 365 file -
Workbook file:
Finance / Reporting / Monthly report.xlsx -
Include hidden worksheets:
false
Result: Flowifier retrieves the workbook's worksheets, publishes only those whose Visibility is Visible, and exposes them through Worksheets. A following For Each Item step can iterate over the collection and use the current worksheet's ID, Name, Position, Visibility, and Is Visible values. The workbook is not modified.
Related information
-
Create Workbook — create a new
.xlsxworkbook before listing its worksheets. - Create Worksheet — add a worksheet to an existing workbook.
- Rename Worksheet — change an existing worksheet name.
- Delete Worksheet — permanently remove a worksheet.
- Microsoft Excel connections — connect a Microsoft work or school account and authorize workbook access.
- Workflow variables — supply dynamic workbook identities and filter behavior.
- Microsoft Graph: List worksheetCollection — provider API behavior for listing worksheets.
Comments
0 comments
Please sign in to leave a comment.