跳到主要内容

AI - 文档解析器 Power Automate

此操作的作用

PDF4me AI - 文档解析器 运行已保存的 分析器PDF4me 仪表板可针对任何文档返回提取的数据,如下所示 已解析文档数据 动态的 JSONPower Automate 流程。一个操作即可涵盖发票、采购订单、收据、合同、实验室报告、身份证或任何自定义表单,只需点击即可。 定制说明 在匹配中 分析器 ID (解析单个模式,分类多个文档变体)。字段以可单独映射的标记形式存在,您可以将其拖放到 SharePointExcel数据宇宙 Outlook或任何下游 Microsoft 365 步。

相关博客文章(1)

测试发票样本

在将流程指向真实数据之前,请使用此供应商发票示例确认操作端到端运行正常。将其上传至 SharePointOneDrive或者 Dropbox,地图 文件内容获取文件内容, 放 文件名供应商发票示例.pdf,并输入 默认发票提取定制说明操作返回 已解析文档数据 例如以下字段 发票号供应商名称, 和 记账到

验证您的身份 API 要求

致电 PDF4me 通过 Power Automate流程需要一个有效的 PDF4me API 关键在于 PDF4me Connect 连接器。从开发者控制面板获取或轮换您的密钥。

首先设置分析器

本指南中将使用的仪表盘网址:
首先创建您的分析器(所有平台均需此步骤)
AI - 文档解析器会在 PDF4me 开发者仪表盘中运行一个已保存的分析器。 选择“解析”可处理单一文档模式,或选择“分类”可在单次调用中对多种变体(如客户ABC、客户XYZ、通用发票)进行路由。同一分析器ID可在Make、Zapier、Power Automate、n8n以及REST API中使用。

您不容错过的重要事实

分析器位于仪表盘中,流程只是引用它。
您只需在设备上定义一次模式(字段、类型、描述)。 分析器列表分析器详情 页。 Power Automate 行动内容 定制说明 选择要运行的分析器。之后更改分析器架构,所有指向同一 ID 的流程都会立即应用更改,无需重建流程。
已解析的文档数据是完全动态的。 JSON
输出对象包含分析器架构中定义的每个字段的一个属性。 Power Automate 直接在每个下游操作的动态内容面板中公开这些属性。否 解析 JSON 需要采取的步骤。
解析还是分类由分析器决定,而不是由操作决定。
相同的操作,两种分析模式。 解析 分析器返回其单一模式中的字段。 分类 分析器将文档路由到最匹配的模式,并返回其分类名称。 匹配的架构提取字段。通过在自定义说明中切换分析器 ID 来切换行为。
Power Automate PDF4me AI - 文档解析器参数选项卡,文件内容已从 Dropbox 文件内容映射,文件名为 Test.pdf,高级参数显示 1/1,自定义说明设置为 default_invoice_extraction

参数选项卡:地图 文件内容 来自前 获取文件内容 步骤,设置 文件名 (使用 供应商发票示例.pdf (使用推荐的样品) 扩展 高级参数然后设置 定制说明默认发票提取 或者您自定义的分析器 ID。

参数

本指南中将使用的仪表盘网址:

操作中需要: 文件内容(二进制)、文件名(带扩展名的字符串)和自定义说明(来自分析器 ID) PDF4me 仪表板位于“高级参数”下,但实际上是必需的(如果没有它,操作将无法提取任何数据)。

范围必需的它的作用例子
File ContentYesBinary content of the source document. Map from a previous Get file content step (SharePoint, OneDrive, Outlook attachment, Dropbox, or any cloud-storage connector that exposes raw bytes). Try the sample-vendor-invoice.pdf above for your first run.File Content
File NameYesSource document filename with extension. Used for format detection and for tracking the call in logs. Accepts .pdf, .png, .jpg, .jpeg. Match the name of the file you uploaded (for example sample-vendor-invoice.pdf).sample-vendor-invoice.pdf
Customisation NoteYes (Advanced)The Analyzer Id from the PDF4me dashboard. Create Analyzers at https://dev.pdf4me.com/dashboard/#/ai-document-parser/ (+ Add), then edit schemas on https://dev.pdf4me.com/ai-document-parser/?id=<analyzer-guid>. Use default_invoice_extraction for invoices, a Parse Analyzer Id for one schema, or a Classify Analyzer Id for several variants.default_invoice_extraction

自定义说明:分析器 ID 如何映射到行为

解析分析器 ID一种模式,提取您定义的字段
最佳做法是处理所有文档时都采用相同的布局格式(例如,仅限您自己的发票)。输出 JSON 包含您所描述的所有属性 字段 在分析仪上。
分类分析器 ID一次调用中包含多个模式、路由和提取。
当一个流程需要处理多个变体(例如,客户 ABC、客户 XYZ、通用发票)时,此方法最为有效。人工智能会将传入的数据进行匹配。 PDF 根据分类提示找到最合适的模式,然后返回匹配的分类名称以及该模式提取的字段。
默认发票提取内置发票分析器
适用于典型的供应商发票。退货 发票号供应商名称记账到无需事先构建自定义架构,即可获取日期和相关标头字段。

输出

动作返回 已解析文档数据 作为动态 JSON分析器架构中定义的每个属性都会作为可单独映射的令牌显示在每个下游操作的动态内容面板中。响应标头也包含标准信息。 Power Automate 路由元数据。

Power Automate AI - 文档解析器运行输出,状态码为 200,JSON 正文包含以下信息:发票号 INV-3337、发票日期 2016 年 1 月 25 日、供应商名称 DEMO - Sliced Invoices、供应商地址、供应商邮箱 admin@slicedinvoices.com、账单收件人 Test Business、账单收件人地址和账单收件人邮箱 test@test.com,这些信息来自示例供应商发票的 default_invoice_extraction 函数。

已成功对示例供应商发票进行运行 默认发票提取状态码 200; 已解析文档数据 每个分析器字段公开一个属性,用于下游映射。

现场(样本运行)示例值
invoiceNumberINV-3337
invoiceDateJanuary 25, 2016
vendorNameDEMO - Sliced Invoices
vendorEmail[email protected]
billToTest Business
billToEmail[email protected]
paymentDeadlineJanuary 31, 2016
输出类型它包含什么
statusCodeInteger200 on success, 400 for a malformed request body, 500 on a server-side error.
headersObjectStandard Power Automate / Microsoft routing headers, including Content-Type application/json.
Parsed Document DataDynamic JSONThe body object. One property per field defined in your Analyzer schema (string, number, date, or nested table). For Classify Analyzers, the Classification Name of the matched Schema is also present.

快速设置

  1. 首先构建分析器。打开 分析器列表, 点击 + 添加输入一个清晰的分析器 ID,选择 解析 或者 分类保存该行,然后在该行上添加文档架构。 分析器详情 请参阅页面。 解析设置指南 或者 分类设置指南 完整攻略请见下文。
  2. 在你的 Power Automate 流程点击 + 新步骤, 搜索 PDF4me, 挑选 AI - 文档解析器
  3. 登录 PDF4me 与您的 API 钥匙。
  4. 文件内容. 前期地图 获取文件内容 步 (SharePointOneDriveOutlook 附件、Dropbox 或任何云存储连接器)。
  5. 文件名将源文件名与扩展名进行映射(sample-vendor-invoice.pdfinvoice.png, ETC)。
  6. 高级参数定制说明输入步骤 1 中的分析器 ID(例如)。 default_invoice_extractionclient_invoices, 或者 purchase order parser)。
  7. 保存流程并进行测试。操作返回 已解析文档数据 架构中每个字段对应一个属性。使用动态内容面板将字段映射到下一步。

工作流程示例

工作流程示例Open by default. Four common AI - Document Parser patterns in a 2x2 grid.
供应商发票 SharePoint 列表
  1. 触发新文件 SharePoint 收到的发票 图书馆。
  2. 获取新文件的内容 PDF
  3. 跑步 AI - 文档解析器 自定义备注设置为您的解析分析器 ID 发票解析器
  4. SharePoint 创建项目 在 AP 列表中,将发票编号、供应商名称、总金额和到期日映射到动态数据。 JSON

影响: 手动数据录入被零接触式AP数据采集取代。

混合供应商收件箱与分类
  1. Outlook 当收到新邮件时 带附件触发器。
  2. 以二进制格式获取附件内容。
  3. 运行 AI - 文档解析器,自定义说明设置为分类分析器 ID(客户发票每个供应商持有一个模式。
  4. 启用返回的分类名称,并将客户端 ABC 字段路由到一个 Dataverse 表,将客户端 XYZ 路由到另一个 Dataverse 表。

影响:Power Automate 流程会自动处理所有供应商,无需人工筛选。

采购订单 Excel 供审核
  1. 新的触发器 PDF 在 Dropbox 中 邮政信箱
  2. 获取文件内容。
  3. 运行 AI - 文档解析器,自定义说明设置为 采购订单解析器
  4. Excel 向表中添加一行 从响应中映射出 SalesOrderNumber、AgentName、OrderDate 和 TotalAmount。

影响: 运营团队无需创建任何采购订单即可查看所有采购订单。 PDF

客户注册表格 Dynamics 365
  1. Power Automate 当收到 HTTP 请求时 从您的门户网站触发。
  2. 解码上传的文件 PDF
  3. 运行 AI - 文档解析器,并将自定义说明设置为您为自定义入职表单创建的解析分析器 ID。
  4. 数据宇宙 添加新行 对于联系人,直接映射公司名称、联系人、电子邮件、税务识别号、账单地址。

影响: 客户自助注册,无需手动录入CRM信息。

常见问题解答

What is the difference between AI - Document Parser and AI-Invoice Parser?+
AI-Invoice Parser uses a fixed schema tuned for invoices (vendor, line items, totals, dates). AI - Document Parser is schema-driven: it runs whatever Analyzer you reference by Customisation Note, built once in the PDF4me dashboard. The same action handles purchase orders, receipts, contracts, custom forms, lab results, ID cards, or anything else you describe in a schema. Pick AI - Document Parser whenever you need flexibility or a non-invoice document type.
Where do I build the Analyzer?+
At https://dev.pdf4me.com/dashboard/#/ai-document-parser/ (Analyzer list, + Add) and https://dev.pdf4me.com/ai-document-parser/?id=<analyzer-guid> (Analyzer detail for schemas). Two analyzer types: Parse (one schema) and Classify (many variants). Reference the Analyzer Id in the Customisation Note field.
What does Customisation Note actually do?+
Customisation Note tells the action which saved Analyzer to apply to your document. Type the Analyzer Id you created in the dashboard (for example default_invoice_extraction, client_invoices, or purchase order parser). The Analyzer schema controls every extracted field; changing this single value lets one Power Automate flow handle multiple document types.
What format is the output and how do I map fields downstream?+
Parsed Document Data is dynamic JSON with one property per field defined in your schema. In SharePoint Create item, Excel Add a row, Dataverse Add a new row, or any downstream action, pick the matching property from the dynamic content panel and drop it into the target column. No Parse JSON step needed.
Which file types does the action accept?+
PDF, PNG, JPG, and JPEG. The Get file content action of any cloud-storage connector that exposes binary file bytes can feed AI - Document Parser. Scanned PDFs work because the AI engine handles OCR internally.
Can one flow process several document variants in one run?+
Yes, with a Classify Analyzer. Build one Classify Analyzer with one Schema per variant (Client ABC, Client XYZ, generic invoice). The AI picks the best-matching Schema at runtime and the action returns its fields plus the Classification Name. Switch on the Classification Name in a Power Automate switch step to route each result to the right downstream destination.
What happens on failure?+
Status code 400 means the request body was malformed (missing File Content, invalid filename, or an Analyzer Id that does not exist in your account). Status code 500 means a transient server-side error, your flow should retry. Use a Try / Catch / Finally scope around the action for production-grade error handling.
Will the same Analyzer work from Make, Zapier, n8n, or the REST API?+
Yes. The Analyzer Id is shared across every platform. Once you save an Analyzer in the dashboard you can call it from Power Automate, Make, Zapier, n8n, or the REST API by passing the same Id. Schema changes propagate to every platform without rewiring.

相关操作

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

获取帮助