Find and Replace Text in Excel using n8n action
PDF4me Replace Text in Excel enables comprehensive search and replace operations in Excel documents through n8n automation workflows with optional formatting application. Process Excel files via n8n triggers, binary data, base64 strings, or public URLs to replace text using literal text matching or regular expressions (regex), with case-sensitive matching options, entire cell or partial matching, multiple replacement phrases in single operation, and optional formatting changes (font, color, size, bold, italic, underline, strikethrough, subscript, superscript). This solution is ideal for data standardization, content updates, error correction, automated text transformation, and privacy masking workflows that require text replacement across all worksheets with comprehensive formatting control and seamless integration.
Setup
Add the PDF4me "Replace Text" 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:
- Add PDF4me node to workflow
- Select "Find and replace text" action
- Configure input parameters (see below)

Parameters
Complete list of parameters for the Replace Text action. Configure these parameters to control text replacement.
Important: Parameters marked with an asterisk (***) are required. This action processes all worksheets in the Excel file.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Input Data Type*** | String | Excel Input Format Selection • Choose the format of your Excel data input • PDF4me supports multiple input types • Options: Binary Data, Base64 String, or URL | Binary Data |
| Input Binary Field*** | Binary | Binary Excel File Input (Required if Binary Data) • Reference Excel file (.xlsx, .xls) from previous n8n node or file upload • PDF4me processes binary Excel files with automatic format detection • Required when Input Data Type is "Binary Data" | {{ $binary.data }} |
| Base64 Excel Content*** | String | Base64 Encoded Excel Input (Required if Base64 String) • Provide Excel content (.xlsx, .xls) as base64 encoded string • PDF4me automatically decodes and processes the Excel content • Required when Input Data Type is "Base64 String" | UEsDBBQABgAI... |
| Excel URL*** | String | Public Excel URL Input (Required if URL) • Provide a public/open permission URL to the Excel file (.xlsx, .xls) • PDF4me downloads and processes the Excel file from the provided URL • Required when Input Data Type is "URL" | https://abc.com/data.xlsx |
| Excel Name*** | String | Excel Input Filename • Specify the name of the input Excel file with proper extension (.xlsx, .xls) • PDF4me uses this for format detection and processing optimization | data.xlsx |
| Phrases*** | String | JSON Array of Replacement Operations • JSON string containing array of ReplacementPhrase objects • Each object: SearchText* (string), ReplacementText* (string, can be empty to delete), IsExpression (bool, default: false - true = regex, false = literal text), CaseSensitive (bool, default: false), MatchEntireCell (bool, default: false - true = entire cell match, false = partial match), Formatting (TextFormatting object - optional: FontName, FontColor, FontSize, Bold/Italic, UnderlineType, StrikethroughType, ScriptType, etc.) • Must contain at least one phrase • Processed sequentially in array order • Matching: Literal text uses string comparison; Regex supports patterns and groups ($1, $2) | [{"SearchText":"old","ReplacementText":"new"}] |
| Binary Data Output Name*** | String | Binary Data Output Mapping • Define the variable name for accessing generated Excel binary data • Used in subsequent workflow actions • Essential for workflow automation | document |
Output
Output Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
| fileName | String | Excel document filename with text replaced - The name of the output Excel document file after text replacement | excel_replaced.xlsx |
| fileSize | Number | File size in bytes - The size of the Excel document in bytes after text replacement | 212808 |
| success | Boolean | PDF4me operation status - Boolean flag indicating the success or failure of the text replacement process. PDF4me returns true for successful operations and false for any errors | true |
| originalFileName | String | Original Excel document filename - The name of the input Excel document file | myExcelFile.xlsx |
| operationsCount | Number | Number of replacement operations - The total count of replacement operations that were processed | 1 |
| operations | Array | Array of replacement operations - Array of objects containing details about each replacement operation performed, including searchText, replacementText, isExpression, matchEntireCell, caseSensitive, and formattingApplied | [{"searchText": "old ", "replacementText": "New", "isExpression": false, "matchEntireCell": false, "caseSensitive": false, "formattingApplied": false}] |
| cultureName | String | Culture/Locale code - Culture code used for document processing (e.g., "en-US", "de-DE", "fr-FR") | en-US |
| message | String | Operation message - Descriptive message indicating the result of the text replacement operation, including the number of operations completed | Text replacement completed successfully with 1 operation(s) |
N8N Action Response
The PDF4me Find and replace text API returns a response that can be viewed in multiple formats. Choose the view that best fits your needs:
- JSON
- Table
- Schema
- Binary
JSON Response Format
The raw JSON response from the API:
[
{
"fileName": "excel_replaced.xlsx",
"fileSize": 212808,
"success": true,
"originalFileName": "myExcelFile.xlsx",
"operationsCount": 1,
"operations": [
{
"searchText": "old ",
"replacementText": "New",
"isExpression": false,
"matchEntireCell": false,
"caseSensitive": false,
"formattingApplied": false
}
],
"cultureName": "en-US",
"message": "Text replacement completed successfully with 1 operation(s)"
}
]
Table View
Response data in a structured table format:
| Parameter | Value |
|---|---|
| fileName | excel_replaced.xlsx |
| fileSize | 212808 |
| success | true |
| originalFileName | myExcelFile.xlsx |
| operationsCount | 1 |
| operations | Array of replacement operation objects |
| cultureName | en-US |
| message | Text replacement completed successfully with 1 operation(s) |
Operations Array Details:
| Parameter | Value |
|---|---|
| searchText | old |
| replacementText | New |
| isExpression | false |
| matchEntireCell | false |
| caseSensitive | false |
| formattingApplied | false |
Schema View
The data structure and types of the response:
1 item
fileName: T excel_replaced.xlsx
fileSize: # 212808
success: ☑ true
originalFileName: T myExcelFile.xlsx
operationsCount: # 1
operations: [] Array
[0]: {} Object
searchText: T old
replacementText: T New
isExpression: ☑ false
matchEntireCell: ☑ false
caseSensitive: ☑ false
formattingApplied: ☑ false
cultureName: T en-US
message: T Text replacement completed successfully with 1 operation(s)
Type Indicators:
T= String (Text)#= Number☑= Boolean[]= Array
Binary Data View
The actual Excel document file data and metadata:
data
─────────────────────────────
File Name: excel_replaced.xlsx
File Extension: xlsx
Mime Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
File Size: 212.8 kB
Binary Data Access:
- n8n Binary Object:
$binary.data.data - Base64 Content: Available for direct use
- File Operations: Ready for download, email, or storage
Note: Invalid phrases are logged as warnings but don't stop processing. Other valid phrases are still processed.
Use Cases
Data Standardization and Format Conversion
- Replace inconsistent values with standard formats across Excel documents
- Convert dates, phone numbers, or identifiers to standard formats
- Standardize currency symbols and numeric formats
Error Correction and Content Updates
- Fix misspellings and data entry errors automatically
- Update product names, prices, or status values across multiple worksheets
- Correct common typos and formatting inconsistencies
Privacy Masking and Data Protection
- Replace sensitive data with masked values for external sharing
- Mask PII (Personally Identifiable Information) using regex patterns
- Apply data anonymization for compliance and privacy requirements