Delete Rows from Excel in Power Automate
PDF4me Delete Rows from Excel is a Power Automate action that removes one or more row ranges from an Excel worksheet using comma-separated range syntax. Use it to trim header rows, drop expired records, or clear sample data whenever a flow hands it a workbook and a range string, returning a cleaned Excel file ready for the next step.
What this action does
PDF4me Delete Rows from Excel takes an Excel file plus a Row Ranges string and removes exactly those rows from the target worksheet. Ranges can mix single rows and hyphenated spans in one request, and PDF4me always deletes from the highest row number down so earlier ranges in the same call are never shifted out of place.
Authenticating Your API Request
To access the PDF4me Web API through Power Automate, every request must include a valid API key. Authentication validates your identity and enables the connector to reach PDF4me's Excel row deletion service from your flow.
Important Facts You Should Not Miss

Map File Content and File Name from a prior action, set Worksheet Name if the target isn't the first sheet, then enter Row Ranges.
Parameters
Required: File Content, File Name, and Row Ranges must always be provided. Worksheet Name is optional and defaults to the first worksheet.
| Parameter | Required | What it does | Example |
|---|---|---|---|
| File Content | Required | Base64 or buffer content of the source Excel file, typically mapped from a prior action like SharePoint Get File Content or OneDrive. | [File Content from Get File] |
| File Name | Required | Name of the Excel file including its extension, used for processing and naming the output. | data.xlsx |
| Worksheet Name | Optional | Exact, case-sensitive name of the worksheet to delete rows from. Blank defaults to the first worksheet (index 0). | Sheet1 |
| Row Ranges | Required | Comma-separated row ranges in 1-based format. A single number deletes one row, a hyphenated pair deletes a span, and multiple entries can be combined, for example 1-5,10,15-20. | 1-5,10,15-20 |
What Does Delete Rows Return?
| Field | Type | What it contains |
|---|---|---|
document | Base64 | The Excel document with the specified rows removed. |
Success | Boolean | true when the deletion completed, false if the request failed validation or processing. |
Error Message | String | Description of what went wrong, null when Success is true. |
Errors | Array | Detailed error entries with Code and Message, empty when Success is true. |
Common Error Messages
| Error Message | Cause | Solution |
|---|---|---|
Request is empty | Request object is null. | Provide a valid request object. |
Document is empty | Document object is null. | Provide a valid Excel document. |
Row ranges are required | RowRanges is null or an empty string. | Provide a valid row range specification. |
Invalid worksheet selection | WorksheetName doesn't exist in the workbook. | Use an existing worksheet name. |
Invalid start row {row}. Row numbers must be positive. | Row number is less than 1, such as "0-5" or "-1". | Use row numbers of 1 or greater (1-based indexing). |
Row {row} exceeds maximum data row ({maxRow}) | Row number is greater than the worksheet's data row count. | Use row numbers within the valid range, 1 to maxRow. |
Invalid range {start}-{end}: End row cannot be less than start row | End row is smaller than start row, such as "10-5". | Make sure the end row is greater than or equal to the start row. |
Invalid row range format | Malformed range string that couldn't be parsed. | Check the syntax, use commas and hyphens correctly. |
How Do I Set Up Delete Rows in Power Automate?
- Add PDF4me → Delete Rows from Excel to your Power Automate flow.
- Map File Content and File Name from a previous action, such as SharePoint or OneDrive Get File Content.
- Set Worksheet Name if the target isn't the first worksheet, otherwise leave it blank.
- Enter Row Ranges as a comma-separated string, for example
1-5,10,15-20. - Run the flow. Rows are deleted bottom-to-top automatically, and the cleaned file returns as
document.
Typical Setups
Workflow ExamplesCommon Power Automate flow patterns using Delete Rows from Excel.
- A flow trigger fires when an internal report is marked ready for a client.
- Get File Content retrieves the report from SharePoint.
- Delete Rows from Excel runs with Row Ranges set to the internal header and footer rows, for example "1-3,96-100".
- The cleaned file is emailed to the client and the original is archived separately.
- A recurrence trigger runs a monthly archival flow.
- Get File Content retrieves the Excel transaction log from SharePoint.
- A prior step identifies rows older than the retention window and builds a Row Ranges string dynamically.
- Delete Rows from Excel removes those rows, and the trimmed log is saved back to SharePoint.
- A new-hire onboarding flow starts in the HR system.
- Get File Content retrieves the expense report template from a templates library.
- Delete Rows from Excel removes the sample rows with Row Ranges set to "2-10" and Worksheet Name set to "Expenses".
- The clean template is emailed to the new employee with row 1 headers intact.
Practical Tips
Cheat Sheet
| Field | Value |
|---|---|
| Action | Delete Rows from Excel |
| File Content | Mapped from a prior file-retrieval action |
| File Name | e.g. data.xlsx |
| Worksheet Name | Blank = first worksheet, or exact case-sensitive name |
| Row Ranges format | 1-based, comma-separated: "1-5,10,15-20" |
| Deletion order | Bottom-to-top automatically, no action needed |
| Output | document (Base64), Success, Error Message, Errors |
Common Questions
Industry Use Cases & Applications
- Finance & Accounting
- Sales & Marketing
- Human Resources
- Operations & Manufacturing
- Education & Training
- Healthcare & Medical
Finance & Accounting Use Cases
- Transaction Cleanup: Delete old or void transaction rows from accounting logs
- Period Close: Remove temporary calculation rows after month-end close
- Report Distribution: Delete internal notes and review comments from client reports
- Budget Templates: Remove previous year sample data from new budget templates
Sales & Marketing Use Cases
- Lead List Cleanup: Delete unqualified or duplicate lead rows from lists
- Campaign Data: Remove test rows and invalid entries from campaign results
- Pricing Updates: Delete obsolete pricing rows from rate sheets
- Territory Management: Remove inactive territory assignments from sales data
Human Resources Use Cases
- Employee Records: Delete terminated employee rows from active rosters
- Payroll Processing: Remove sample data from payroll templates for new hires
- Benefits Enrollment: Delete expired enrollment options from benefits sheets
- Performance Reviews: Remove old review cycle data from tracking sheets
Operations & Manufacturing Use Cases
- Inventory Cleanup: Delete discontinued product rows from inventory lists
- Production Logs: Remove old production run data beyond retention period
- Quality Control: Delete invalid or rejected inspection result rows
- Maintenance Records: Remove completed maintenance task rows from active schedules
Education & Training Use Cases
- Student Rosters: Delete graduated student rows from class rosters
- Course Catalogs: Remove discontinued course rows from catalog sheets
- Grade Books: Delete sample grade entries from new semester templates
- Training Records: Remove expired certification rows from tracking sheets
Healthcare & Medical Use Cases
- Patient Lists: Delete discharged patient rows from active treatment lists
- Appointment Schedules: Remove past appointment rows from schedule templates
- Lab Results: Delete old test result rows beyond retention requirements
- Insurance Claims: Remove processed claim rows from active claims tracking