Skip to main content

Delete Rows from Excel in Power Automate

PDF4me Delete Rows from Excel action enables removal of specified row ranges from Excel documents in Power Automate with flexible range syntax and intelligent deletion ordering. This powerful cleanup feature supports deletion of single rows, multiple individual rows, or continuous row ranges using comma-separated range syntax, with automatic bottom-to-top deletion to prevent index shifting issues and maintain worksheet structure integrity, perfect for data cleanup, report trimming, and automated Excel file maintenance across Microsoft 365 workflows.

Authenticating Your API Request

To access the PDF4me Web API through Power Automate, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user, enabling seamless integration between your Power Automate flows and PDF4me's powerful Excel row deletion services.

Delete Rows from Excel Power Automate

Key Features

  • Flexible Range Syntax: Delete single rows, ranges, or mixed combinations using simple comma-separated format
  • Multiple Range Support: Process multiple row ranges in a single operation
  • Smart Deletion Order: Automatic bottom-to-top deletion prevents index shifting issues
  • Worksheet Targeting: Specify worksheet by name or use first worksheet by default
  • Structure Preservation: Maintains worksheet integrity with automatic row shifting

Parameters

Complete list of parameters for the Delete Rows from Excel action. Configure these parameters to control row deletion.

Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.

ParameterTypeDescriptionExample
File Content***Base64Source Excel File Content
• Map Excel file from previous action output
• Supports Excel files from SharePoint, OneDrive, email attachments
• Can be dynamically retrieved from flow variables
• Must be valid Excel document (.xlsx, .xls formats)
[File Content from Get File]
File Name***StringExcel Document Name
• Specify Excel file name with extension (.xlsx, .xls)
• Used for processing and output file naming
• Must include proper file extension
• Supports dynamic naming from flow variables
data.xlsx
Row Ranges***StringRow Ranges to Delete
• Comma-separated row ranges in 1-based format (row 1 = first row)
Single row: "5" - Delete row 5 only
Range: "1-10" - Delete rows 1 through 10
Multiple rows: "5,10,15" - Delete rows 5, 10, and 15
Mixed format: "1-5,10-15,20" - Delete rows 1-5, 10-15, and row 20
Brackets optional: "[1-5]" same as "1-5"
Deletion Order: Rows deleted bottom-to-top (highest row first) to prevent index shifting
1-5,10,15-20
Worksheet NameStringTarget Worksheet Name
• Name of worksheet to delete rows from
• Null or empty defaults to first worksheet (index 0)
• Must match worksheet name exactly
• Case-sensitive worksheet name
Sheet1

Output

The PDF4me Delete Rows from Excel action returns comprehensive output data for seamless Power Automate flow integration:

Table View

Response data in a structured table format:

ParameterTypeDescription
documentBase64Excel document with specified rows deleted
SuccessBooleantrue if operation successful, false if failed
Error MessageStringError description (null if successful)
ErrorsArrayList of detailed error information (empty array if successful)

Common Error Messages

Understanding and troubleshooting errors helps ensure smooth Excel row deletion workflows:

Error MessageCauseSolution
"Request is empty"Request object is nullProvide valid request object
"Document is empty"Document object is nullProvide valid Excel document
"Row ranges are required"RowRanges is null or empty stringProvide valid row range specification
"Invalid worksheet selection"WorksheetName doesn't exist in workbookUse existing worksheet name
"Available worksheets in workbook (X total)"Informational message when worksheet validation failsReview worksheet name and use valid value from X available worksheets
"Invalid start row {row}. Row numbers must be positive."Row number < 1 (e.g., "0-5", "-1")Use row numbers ≥ 1 (1-based indexing)
"Row {row} exceeds maximum data row ({maxRow})"Row number > worksheet's data row countUse row numbers within valid range (1 to maxRow)
"Invalid range {start}-{end}: End row cannot be less than start row"End row < start row (e.g., "10-5")Ensure end row ≥ start row in ranges
"Invalid row range format"Malformed range string that couldn't be parsedCheck syntax: use commas and hyphens correctly

Workflow Examples

The PDF4me Delete Rows from Excel action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:

Automated Report Header/Footer Cleanup Workflow

Transform your report distribution with automated removal of internal headers and footers:

Complete Workflow Steps:

  1. Trigger: Internal report marked as "Ready for Client"
  2. Get Excel Report: Retrieve internal report from SharePoint
  3. Delete Header Rows: Remove rows 1-3 (internal headers and instructions)
  4. Delete Footer Rows: Remove last 5 rows (internal notes and formulas)
  5. Set Parameters: RowRanges = "1-3,96-100" (assuming 100 total rows)
  6. Add Client Headers: Insert client-appropriate headers (separate action)
  7. Email Client: Send cleaned report to client stakeholders
  8. Archive Original: Keep internal version in separate folder

Business Benefits:

  • Cleans 50+ client reports monthly automatically
  • Removes confidential internal notes and instructions
  • Ensures professional client-ready appearance
  • Saves 20 minutes per report in manual cleanup

Industry Use Cases & Applications

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

Get Help