Skip to main content

Delete rows from Excel worksheet using n8n action

PDF4me Delete Rows lets you strip out unwanted rows (headers, blank lines, outdated sections) directly from n8n. Provide a comma-separated list of 1-based row numbers or ranges, optionally target a worksheet, and PDF4me deletes from the bottom up to avoid shifting issues. Ideal for sanitizing exports before sharing or preparing templates for end users.

Setup

Add the PDF4me “Delete Rows” node to your n8n workflow and configure the required parameters. For initial setup instructions, see our n8n Integration Guide.

Prerequisites

  • PDF4me API credentials
  • n8n workflow access

Configuration

  1. Add the PDF4me node to the workflow
  2. Select the "Delete rows from Excel worksheet" action
  3. Supply the workbook source and range string
Delete Rows from Excel

Parameters

Important: Parameters marked with an asterisk (***) are required. Row numbers in the range string are 1-based.

ParameterTypeDescriptionExample
Input Data Type***StringWorkbook source selector (Binary Data, Base64 String, URL).Binary Data
Input Binary Field***BinaryRequired when using Binary Data.{{ $binary.data }}
Base64 Document Content***StringRequired when using Base64 String.UEsDBBQAAAA...
Document URL***StringRequired when using URL. Public HTTPS link to the workbook.https://files.example.com/report.xlsx
File Name***StringLogical filename (with extension) for tracking.operations.xlsx
Row Ranges***StringRow range string. Accepts single rows (5), ranges (10-20), or mixed (1-3,8,15-18). Rows deleted bottom-to-top.1-3,10,25-30
Worksheet NameStringWorksheet to clean. Empty = first sheet.Summary
Binary Data Output Name***StringBinary slot that will hold the cleaned workbook.document

Output

Output Parameters

ParameterTypeDescriptionExample
fileNameStringExcel document filename with rows deleted - The name of the output Excel document file after row deletionexcel_rows_deleted.xlsx
fileSizeNumberFile size in bytes - The size of the Excel document in bytes after row deletion212997
successBooleanPDF4me operation status - Boolean flag indicating the success or failure of the row deletion process. PDF4me returns true for successful operations and false for any errorstrue
originalFileNameStringOriginal Excel document filename - The name of the input Excel document filemyExcelFile.xlsx
worksheetNameStringWorksheet name - The name of the worksheet where rows were deletedsheet2
rowRangesStringRow ranges deleted - The row range string that was used for deletion (e.g., "10-20", "1-3,8,15-18")10-20
messageStringOperation message - Descriptive message indicating the result of the row deletion operation, including the row ranges and worksheet nameSuccessfully deleted rows 10-20 from worksheet 'sheet2'

N8N Action Response

The PDF4me Delete rows from Excel worksheet API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:

JSON Response Format

The raw JSON response from the API:

[
{
"fileName": "excel_rows_deleted.xlsx",
"fileSize": 212997,
"success": true,
"originalFileName": "myExcelFile.xlsx",
"worksheetName": "sheet2",
"rowRanges": "10-20",
"message": "Successfully deleted rows 10-20 from worksheet 'sheet2'"
}
]

Use Cases

  • Report cleanup: Remove internal notes, totals, or blank separators before sending to clients.
  • Template preparation: Strip example rows from Excel templates prior to onboarding new users.
  • Compliance workflows: Drop expired records or retention-exceeded rows automatically.

Get Help