Actions23
- Spreadsheet Actions
- Sheet Filter Actions
- Sheet Filter View Actions
- Filter Condition Filter View Actions
- Sheet Row Column Actions
- Sheet Data Actions
- Sheet Floating Image Actions
Overview
The "Replace" operation on the "Sheet Data" resource in this node allows users to find and replace specific content within a sheet of a spreadsheet managed by Lark Sheets. This operation is useful for automating bulk text replacements, correcting data entries, or updating values across a sheet without manual editing.
Typical use cases include:
- Automatically replacing outdated terms or codes in a sheet.
- Correcting typos or formatting errors across multiple cells.
- Updating references or links embedded in sheet cells.
- Performing regex-based search and replace operations for advanced text manipulation.
For example, you could replace all occurrences of "Pending" with "Completed" in a project status column, or update product codes following a new naming convention.
Properties
Name | Meaning |
---|---|
Authentication | Method of authenticating API requests. Options: Tenant Token, OAuth2. |
Spreadsheet Token | The unique token identifying the target spreadsheet where the replacement will occur. |
Sheet Id | The identifier of the specific sheet within the spreadsheet to perform the replacement on. |
Find | The string or pattern to search for within the sheet cells. |
Find Condition | A collection of options refining how the find operation behaves: - include_formulas: Whether to include formulas in the search. - match_case: Whether the search is case-sensitive. - match_entire_cell: Whether to match the entire cell content exactly. - range: Specific cell range to limit the search. - search_by_regex: Whether the find string should be treated as a regular expression. |
Replacement | The string that will replace each found occurrence matching the find criteria. |
Custom Body | Allows sending a fully custom JSON body for the request instead of using the standard parameters. Useful for advanced or unsupported scenarios. |
Options > Use Custom Body | Boolean flag to indicate whether to use the Custom Body property instead of the standard find/replace parameters. |
Output
The node outputs JSON data representing the result of the replace operation. Typically, this includes confirmation of the replacement action, such as the number of replacements made or status information from the Lark Sheets API.
If binary data output is supported (not indicated here), it would represent file contents or attachments related to the sheet, but this node primarily deals with JSON responses.
Dependencies
- Requires an active connection to Lark Sheets via either a Tenant Token or OAuth2 authentication.
- Needs valid spreadsheet and sheet identifiers to target the correct document.
- The node sends HTTP requests to the Lark Suite Open APIs endpoint
https://open.larksuite.com/open-apis
. - Proper API credentials must be configured in n8n for authentication.
Troubleshooting
- Invalid Spreadsheet or Sheet ID: Ensure the provided tokens and IDs are correct and that the authenticated user has access rights.
- Authentication Errors: Verify that the API key or OAuth2 token is valid and not expired.
- No Matches Found: If no replacements occur, check the find string and conditions (case sensitivity, regex usage, range) to ensure they correctly target the intended cells.
- Malformed Custom Body: When using the custom body option, ensure the JSON structure matches the expected API schema to avoid request failures.
- API Rate Limits: Large or frequent replace operations may hit API rate limits; consider batching or adding delays if necessary.
Links and References
- Lark Sheets API Documentation
- Regular Expressions Guide
- n8n HTTP Request Node Documentation (for understanding underlying HTTP calls)