删除行 Excel 在 Power Automate
PDF4me 删除行 Excel 是一个 Power Automate 从列表中删除一个或多个行范围的操作 Excel 使用逗号分隔的范围语法来处理工作表。当流程向其传递工作簿和范围字符串时,可以使用此方法修剪标题行、删除过期记录或清除示例数据,并返回一个清理后的工作表。 Excel 文件已准备好进行下一步操作。
此操作的作用
PDF4me 删除行 Excel 需要 Excel 文件加上行范围字符串,即可从目标工作表中删除指定的行。一次请求中可以同时包含单行和带连字符的跨行。 PDF4me 总是从最高行号向下删除,因此同一调用中的较早范围永远不会移位。
相关博客文章
目前尚无关于此功能的博客文章——敬请期待。
在此期间,您可以浏览 PDF4me 博客,查看适用于各平台的教程和工作流程。
访问博客 →
验证您的身份 API 要求
要访问 PDF4me 网站 API 通过 Power Automate每个请求都必须包含一个有效的 API 密钥。身份验证用于验证您的身份,并使连接器能够访问。 PDF4me的 Excel 从您的流程中删除行。
您不容错过的重要事实
行范围是一个以逗号分隔的字符串
将单行和连字符范围合并到一个字段中,例如 1-5,10,15-20。可选的括号 [1-5] 与 1-5 一样有效。
删除操作总是从下往上执行。
PDF4me 会自动首先删除最高行号,因此同一请求中的其他范围永远不会因先前的删除而移位。
工作表名称(可选)
留空则选取工作簿中的第一个工作表,或者输入区分大小写的确切名称以选取特定工作表。

从先前的操作中映射文件内容和文件名,如果目标不是第一个工作表,则设置工作表名称,然后输入行范围。
参数
必需的: 文件内容、文件名和行范围必须始终提供。工作表名称为可选,默认为第一个工作表。
| 范围 | 必需的 | 它的作用 | 例子 |
|---|---|---|---|
| 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 |
删除行会返回什么?
| 场地 | 类型 | 它包含什么 |
|---|---|---|
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. |
常见错误信息
| 错误信息 | 原因 | 解决方案 |
|---|---|---|
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. |
如何在……中设置删除行 Power Automate?
- 添加 PDF4me → 删除行 Excel 致你 Power Automate 流动。
- 地图 文件内容 和 文件名 源自之前的操作,例如 SharePoint 或者 OneDrive 获取文件内容。
- 放 工作表名称 如果目标不是第一个工作表,则留空。
- 进入 行范围 例如,以逗号分隔的字符串形式。
1-5,10,15-20。 - 运行流程。行将自下而上自动删除,清理后的文件将返回为
document。
典型配置
工作流程示例Common Power Automate flow patterns using Delete Rows from Excel.
报告页眉和页脚清理
- 当内部报告被标记为已准备好交付给客户时,流程触发器就会触发。
- 获取文件内容从中检索报告 SharePoint。
- 删除行 Excel 运行时,行范围设置为内部页眉和页脚行,例如“1-3,96-100”。
- 清理后的文件将通过电子邮件发送给客户,而原始文件将单独存档。
计划事务日志修剪
- 循环触发器会运行每月一次的归档流程。
- 获取文件内容 Excel 来自事务日志 SharePoint。
- 先前的步骤会识别早于保留窗口的行,并动态构建行范围字符串。
- 删除行 Excel 删除这些行,并将精简后的日志保存回目标位置。 SharePoint。
模板样本数据删除
- 新员工入职流程从人力资源系统开始。
- 获取文件内容从模板库中检索费用报告模板。
- 删除行 Excel 删除行范围设置为“2-10”且工作表名称设置为“费用”的示例行。
- 干净的模板会以电子邮件的形式发送给新员工,第一行标题保持不变。
实用技巧
Count rows before building the range string
Row Ranges rejects any row number past the worksheet's data row count, so confirm the row count first if you are constructing ranges dynamically from another action's output.
Combine ranges in one call instead of looping
A single Row Ranges string like "1-5,10,15-20" deletes multiple spans in one action run, which is simpler to maintain than chaining several Delete Rows actions.
Match Worksheet Name exactly, including case
Worksheet Name comparison is case-sensitive. A mismatch returns an invalid worksheet selection error even if the name looks correct at a glance.
Brackets around a range are optional
Both "1-5" and "[1-5]" are accepted for the same range, so either format works if the string is being generated by another system.
Don't worry about deletion order in the input
You can list ranges in any order in Row Ranges. PDF4me sorts and deletes from the highest row number down automatically to avoid index shifting.
速查表
| 场地 | 价值 |
|---|---|
| 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 |
常见问题
行业应用案例及应用
- Finance & Accounting
- Sales & Marketing
- Human Resources
- Operations & Manufacturing
- Education & Training
- Healthcare & Medical
财务与会计应用案例
- 交易清理从会计日志中删除旧的或无效的交易记录
- 期末结算月末结算后删除临时计算行
- 报告分发删除客户报告中的内部备注和审核评论
- 预算模板从新的预算模板中移除上一年的示例数据
销售与市场营销用例
- 潜在客户名单清理从列表中删除不合格或重复的潜在客户行
- 活动数据从广告系列结果中删除测试行和无效条目
- 价格更新从价格表中删除过时的价格行
- 区域管理从销售数据中移除不活跃的区域分配
人力资源应用案例
- 员工记录从活跃名册中删除已离职员工的行
- 薪资处理:从新员工薪资模板中移除示例数据
- 福利登记从福利表中删除已过期的参保选项
- 绩效考核从跟踪表中移除旧的审核周期数据
运营与制造应用案例
- 库存清理从库存列表中删除已停产的产品行
- 生产日志删除超过保留期限的旧生产运行数据
- 质量控制删除无效或被拒绝的检验结果行
- 维护记录从活动计划中移除已完成的维护任务行
教育与培训应用案例
- 学生名册从班级名册中删除已毕业学生的行
- 课程目录从课程目录单中删除已停开的课程行
- 成绩册从新学期模板中删除示例成绩条目
- 培训记录从跟踪表中删除已过期的认证行
医疗保健应用案例
- 病人名单从活跃治疗列表中删除已出院患者行
- 预约安排从日程模板中删除过去的预约行
- 实验室结果删除超出保留期限的旧测试结果行
- 保险索赔从有效索赔跟踪中移除已处理的索赔行
相关操作
添加行
插入新行 JSON 数据输入到 Excel 工作表,与删除行相反的操作。
更新行
就地修改现有行的值,当需要更正行而不是删除行时非常有用。
提取行
将特定行范围提取到新文件中,而不是删除它们,这对于清理前的归档非常有用。
在其他平台上执行相同任务
Make从 Excel 中删除行
相同的行范围删除模块 Make 适用于与 Dropbox 和 Google Drive 模块配合使用的各种场景。
n8n删除行
对于自托管或云端部署,同一行删除节点也适用。 n8n 工作流程。
Zapier删除行
同样的操作 Zapier将其连接到 Google 表格或 CRM Zap 中已包含触发器。
PDF4me API删除行
直接调用相同的行删除端点 REST 用于外部自定义集成 Power Automate。