Use Insert Worksheet Rows to insert one or more full rows at a one-based position in an existing .xlsx worksheet. Microsoft Excel shifts existing cells down, and the step refuses to insert rows that intersect a structured Excel table.
Step Library: Microsoft Excel > Worksheet rows
When to use this step
Use this step when you want to:
- create blank full rows at a known worksheet position;
- shift existing worksheet content down without changing workflow variables; or
- make the inserted range and resolved workbook available to following steps.
Common examples include:
- inserting rows before a worksheet summary or footer;
- reserving blank rows for values written by later workflow steps; or
- moving existing worksheet content down to make room for a new section.
Use Add Table Rows instead when you need to add rows to a structured Excel table. Use Update Worksheet Row when you want to replace cell values without inserting a row, or Delete Worksheet Rows when you want to remove full rows.
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 edit the target
.xlsxworkbook. - Ensure the rows to insert do not intersect a structured Excel table.
- 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 Insert Worksheet Rows from Microsoft Excel > Worksheet rows.
- 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.
- Select the Worksheet.
- Enter the one-based Starting row number and the Number of rows to insert, or select compatible Number variables.
- 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 write 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. 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. |
| Worksheet | Yes | Selected worksheet, fixed worksheet ID or exact name, or Text variable | Always | Identifies the worksheet to change. There is no default. The worksheet picker is available when the connection and workbook can be resolved while authoring. At runtime, a fixed or variable value must resolve to an existing worksheet reference. |
| Starting row number | Yes | Fixed whole Number or Number variable from 1 to 1,048,576
|
Always | One-based row at which insertion begins. There is no default. Fixed invalid values are rejected by Designer validation; variables are resolved and validated at runtime. |
| Number of rows | Yes | Fixed whole Number or Number variable from 1 to 1,048,576
|
Always | Number of full rows to insert. The default is 1. Fixed invalid values are rejected by Designer validation; variables are resolved and validated at runtime. The last inserted row must not exceed row 1,048,576. Whether the target rows intersect a structured table is checked at runtime. |
Data and outputs
Workflow variable effects
This step does not modify workflow variables. It only reads selected variables when resolving its configuration.
Step outputs
| Step output | Type | Available when | Scope | Description |
|---|---|---|---|---|
| Range | Object — Microsoft Excel Range Reference (microsoft-excel/range-reference@1) |
After successful completion | Following steps in the current workflow context until the execution path ends | Reference to the inserted full-row range. It contains Worksheet ID, Address, Start Row, and Row Count. Start Column and Column Count are absent because the operation inserts full rows. Worksheet ID contains the worksheet reference resolved for the call; the Object does not contain a separate worksheet-name property. No Range output is exposed when the step fails. |
| Workbook | Object — Microsoft Excel Workbook (microsoft-excel/workbook@1) |
After successful completion | Following 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 only when the selected input provides them. File selections and explicit drive and item IDs can therefore expose only the required IDs. No Workbook output is exposed when the step fails. |
Range object
| Property | Type | Description |
|---|---|---|
| Worksheet ID | Text | Worksheet reference resolved for the provider call. The Object does not include a separate worksheet-name property. |
| Address | Text | Inserted full-row address in start:end form, such as 3:4. |
| Start Row | Number | One-based starting row of the inserted range. |
| Row Count | Number | Number of inserted rows. |
| Start Column | Number | Not present for full-row insertion. |
| Column Count | Number | Not present for full-row insertion. |
Runtime behavior
Execution and completion
When the step runs, Flowifier:
- Resolves the selected connection, workbook, worksheet, starting row, and row count.
- Validates each row value and verifies that the last inserted row does not exceed row
1,048,576. - Opens a persistent Microsoft Excel workbook session.
- Reads the workbook's tables and their ranges to verify that the requested rows do not intersect a structured table.
- Requests insertion of the full rows and tells Microsoft Excel to shift existing cells down.
- Exposes Range and Workbook, then completes the step. The workbook session is closed on a best-effort basis.
Row insertion is an externally visible side effect. The inserted rows remain in the workbook if a later workflow step fails. Running the step again inserts the rows again and shifts the current content down again; the operation is not idempotent.
Branches and child steps
This step does not have branches or child steps. When it is placed inside a branch or child-step context, its outputs follow that context's normal scope and do not escape the execution path on which they were created.
Failure, retry and resume behavior
This step does not suspend execution and has no resume point. Safe session setup and table-read requests may retry transient throttling or service errors before the insertion request is sent. The row-insertion request itself is not automatically retried.
If validation, authentication, permission, table-intersection, provider, or output validation fails before insertion, the step fails, exposes no step outputs, and the workflow does not continue along its normal execution path.
Because row insertion is a mutation, a network interruption, timeout, or service failure after Microsoft Graph receives the request can leave the outcome unknown. The rows might already have been inserted even though the step failed. Inspect the workbook before starting another execution. Concurrent insertions into the same worksheet are independent provider requests and can shift row positions or produce a provider conflict.
Cancellation or termination cannot remove rows that Microsoft Graph has already inserted.
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, the settings shown for the selected Workbook source, Worksheet, Starting row number, and Number of rows. |
A fixed row value is not a whole Number from 1 to 1,048,576
|
Designer validation reports the invalid setting and prevents a valid publish. | Enter a supported whole Number for Starting row number and Number of rows. |
| A variable is missing, has the wrong type or Object schema, or resolves to an empty or invalid value | The step fails before insertion and reports the invalid input. No step output is exposed. | Ensure the variable exists, has the compatible type or schema, and resolves to a value accepted by its setting. |
The starting row plus the row count exceeds row 1,048,576
|
The step fails before insertion, reports the row-count input, and leaves the workbook unchanged. | Reduce Starting row number or Number of rows so the full inserted range fits in the worksheet. |
| The requested full rows intersect a structured Excel table | The step fails before insertion and leaves the workbook unchanged. | Insert rows outside the table, or use Add Table Rows to change the table. |
| The workbook or worksheet does not exist, is inaccessible, protected, locked, or not a supported file | The step fails and exposes no step outputs. | Select an accessible, editable .xlsx workbook and an existing worksheet, remove protection or locks when appropriate, or correct the supplied IDs or names. |
| 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 write access to the workbook. |
| Microsoft Graph throttles or cannot confirm the insertion result | Safe reads may retry, but the insertion request is not automatically retried. If the request was dispatched, the rows might already have been inserted. | Inspect the workbook first. If no rows were inserted, wait if necessary and start a new execution. |
| A successful configuration is executed again | The step inserts another set of rows and shifts the current worksheet content down again. | Design the workflow to prevent duplicate execution, or verify the workbook before deliberately rerunning the step. |
Example
Insert two rows before a worksheet summary
Goal: Create two blank rows before a summary section and make the inserted range available to following steps.
Configuration:
-
Connection:
Finance Microsoft Excel -
Workbook source:
Microsoft 365 file -
Workbook file:
Monthly close.xlsx -
Worksheet:
Summary -
Starting row number:
10 -
Number of rows:
2
Result: Flowifier inserts blank rows 10 and 11. The previous row 10 and all following worksheet content shift down by two rows. Range contains address 10:11, start row 10, and row count 2; Workbook identifies the changed workbook.
Related information
- Add Table Rows — add records to a structured Excel table instead of inserting full worksheet rows.
- Update Worksheet Row — replace values in a worksheet row without shifting other rows.
- Delete Worksheet Rows — remove full worksheet rows and shift remaining cells up.
- List Worksheets — retrieve worksheet references from an existing workbook.
- Microsoft Excel connections — connect a Microsoft work or school account and authorize workbook access.
- Microsoft Graph: Insert range — provider API behavior for inserting cells and shifting existing content.
Comments
0 comments
Article is closed for comments.