跳到主要内容

解析文档 Zapier

此操作的作用

PDF4me 解析文档 使用您保存的解析模板对 PDFZapier Zap 并返回提取的字段,以便映射到下一步。可从 6000 多个触发器中的任何一个触发。 Zapier 应用程序(Gmail、Dropbox、Slack、Google Drive、OneDrive、Webhooks)引用此模板 模板名称(TemplateId)并将解析后的值直接路由到 Google Sheets、Airtable、HubSpot、Pipedrive、QuickBooks 或任何下游应用程序。

相关博客文章(1)

执行此操作之前: 在解析模板中创建解析模板 PDF4me 仪表板。定义您的捕获密钥并选择 正则表达式 对于稳定模式或 JavaScript 表达 用于条件逻辑。 Zapier 操作引用该模板 模板 ID。 看 准备文档解析信息 完整设置请参见正则表达式示例(INV-\d{6,10}\d{2}/\d{2}/\d{4}),以及两个工作单位 JavaScript 表达式分类器样本。

验证您的身份 API 要求

PDF4me 行动 Zapier 需要一个 PDF4me 账户连接使用您的账号登录一次 API 密钥并在每个地方重复使用 PDF4me 在您的 Zap 中执行操作。

您不容错过的重要事实

模板名称接受模板 ID GUID
尽管字段标签可能有所不同,但请从控制面板粘贴 GUID TemplateId。它在重命名后仍然稳定,并且是 Zap 重新发布后的安全生产值。
用于稳定模式的正则表达式 JavaScript 用于条件逻辑
捕获规则位于模板中。使用正则表达式来指定发票编号、日期和金额。 JavaScript 用……表达 文本 用于分类和回退规则的变量。每个捕获键都会成为操作的输出字段。
适用于任何 Zapier 文件输入
文件字段接受二进制文件 PDF 来自任何上游 Zapier 步骤(Gmail 新建附件、Dropbox 新建文件、Google 云端硬盘、Slack、webhook、 Zapier 存储)。相同的 TemplateId 适用于 Maken8nPower Automate以及直接 REST
Zapier 中的解析文档操作

参数

范围必需的它的作用例子
FileYesBinary PDF from any upstream Zapier step: Gmail New Attachment, Dropbox New File in Folder, Google Drive New File in Folder, OneDrive New File, Slack New File, webhook with file payload. Pick from the prior step output.Attachment from Gmail
Document NameYesSource filename including .pdf extension. Usually mapped from the same upstream step Filename output.invoice.pdf
Template NameYesTemplateId GUID from the PDF4me dashboard. Identifies which parse template (capture keys + extraction rules) the action should apply.12345678-1234-1234-1234-123456789abc

解析模板中的表达式类型

正则表达式稳定模式
发票号码(INV-\d{6,10}),日期(\d{2}/\d{2}/\d{4}),金额($?\d{1,3}(?:,\d{3})*(?:.\d{2})?约 80% 的生产捕获密钥。
JavaScript 表达式条件逻辑和分类器
捕获区域文本以如下方式传递: 文本返回一个字符串。支持多标记分类、回退规则和日期规范化。参见 准备文档解析信息 提供两个工作样品。

输出

该操作返回已解析的字段数据,如下所示。 Zapier 输出值,模板中每个捕获键对应一个字段。在任何下游步骤中,都可以从动态字段选择器中选择这些字段。

在 Zapier 中解析文档,输出结果显示已解析的字段

Zap 示例

常见的 Zapier 模式Typical ways to chain Parse Document into a Zap.
Gmail发票导入Google表格
  1. Gmail 新建附件功能会根据“供应商发票”等标签触发。
  2. 过滤器只通过以 .pdf 结尾的文件。
  3. 解析文档时,会根据附件运行发票模板。
  4. Google Sheets 创建电子表格行会将 invoiceNumber、totalAmount 和 invoiceDate 写入 AP 跟踪表。
Dropbox 收据导入 Airtable
  1. Dropbox 在文件夹中新建文件操作在 /receipts 上触发。
  2. 解析文档运行收据模板。
  3. Airtable 创建记录功能会将供应商、日期、总计和项目写入费用数据库。
  4. Slack 发送频道消息,向 #finance 发布摘要。
Webhook 与 HubSpot 的合约
  1. 通过 Webhooks Zapier Catch Hook 收到了一份新合同 PDF
  2. 解析文档提取合同双方、合同金额、开始日期、结束日期。
  3. HubSpot 创建或更新交易功能会将合同数据写入交易记录。
  4. 出站 webhook 会通知交易所有者。

常见问题解答

What goes in the Template Name field?+
Paste the TemplateId GUID from the PDF4me dashboard. Despite the field label, the GUID is the safer production value. It is stable across renames and identical to the value used by the REST API and the other platform connectors.
Where does the PDF file come from in a Zap?+
Any upstream Zapier step that exposes a file: Gmail New Attachment, Dropbox New File in Folder, Google Drive New File in Folder, OneDrive New File, Slack New File, Webhooks Catch Hook with file payload, Zapier Storage. Pick the file from the prior step output.
Do I have to build a template, or can the Zap parse any PDF?+
Template-based parsing is the supported production mode. Build the template once in the dashboard, then reference its TemplateId. The same TemplateId works in Make, n8n, Power Automate, and direct REST calls.
Can I extract data using JavaScript at parse time?+
Yes. Inside the template add a JavaScript Expression on a capture key. The capture area text is passed as the variable text and your function returns a string. The returned value appears in your Zap as a regular output field you can map into the next step.
How do I see the extracted fields in the field picker?+
Run the Test step at least once. Zapier reads the live response, learns the capture key names from your template, and surfaces them in the dynamic field picker of every downstream step.
What if my template changes (I add a new capture key)?+
Re-test the Parse Document action. Zapier re-reads the output and adds the new field to the picker. Then map it into downstream steps. The TemplateId stays the same so no other Zap step needs to change.

相关行动

在其他平台上执行相同的任务

获取帮助