Google Docs 模板 Power Automate
这 Google Docs 家庭 是一个 Power Automate 生成文档:使用模板设计的单个选项 Google Docs 并导出为 .docx将该文件映射到“生成单个文档”中,并将其与您的文件合并。 JSON 或者 XML 数据,并获得个性化信息 PDF 或者 Word 文件返回。当您的团队编写模板时,请选择它。 Google Docs 而不是 Microsoft Word。
开始之前
google-docs-template.docx 已经导出并准备就绪。google-docs-data.json (受到推崇的), test.xml, 或者 测试.csv模板中的占位符名称与数据键相匹配。示例文件包
请下载以下文件。 Google Docs 模板加上匹配数据 JSON, XML, 和 CSV绘制地图 .docx 从 SharePoint, OneDrive, 或者 Dropbox 生成单个文档。

目标配置 Google Docs 导出:映射 .docx 在下面 模板文件数据, 放 模板文件类型 到 Docx并粘贴 JSON 进入 Document Data 文本。
什么是 Google Docs 模板 Power Automate?
这 Google Docs 家庭模式允许您创建模板 Google Docs将其导出为 .docx并将其与数据合并 Power Automate 流程。因为导出的文件是 .docx它贯穿始终 Word 模板引擎,并支持 Mustache 风格的占位符,例如: {{姓名}}对于喜欢这种方式的团队来说,这是最简单的选择。 Google Workspace 超过 Microsoft Word 用于模板设计。
我该如何配置 Google Docs 模板 Power Automate?
按如下方式设置操作字段。“生成文档”单项映射导出的内容 .docx 从之前的“获取文件”步骤中获取。对于已保存的模板, PDF4me 账户,使用 使用模板生成文档 反而。
| 范围 | 必需的 | 它的作用 | 例子 |
|---|---|---|---|
| Connection | Required | PDF4me connection for the flow. Create one with your API key, then reuse it across every PDF4me action. | My PDF4me connection |
| Template File Type | Required | Format of the template file. A Google Docs export is a .docx, so choose PDF4me Word Template (Docx). | PDF4me Word Template |
| Output Type | Required | Format of the generated document. PDF for a locked layout, or Word for an editable .docx. | PDF |
| Template Name | Required | Filename of the exported template including the .docx extension. Map from the prior Get file step. | google-docs-template.docx |
| Template | Required | Binary content of the Google Docs export. Map File Content from SharePoint, OneDrive, or Dropbox Get file content. | File Content |
| Document DataType | Required | Format of the data payload. Json maps cleanly from SharePoint columns and Forms. Xml is for XML source systems. | Json |
| Document Data Text | Conditional | Inline data payload built from dynamic content. Required when Document Data File is empty. | [{ "name": "Alice Johnson" }] |
| Document Data File | Conditional | A JSON or XML data file mapped from a prior step. Required when Document Data Text is empty. | 1. Data |
| Meta Data Json | Optional | Document metadata for fields in JSON format. Leave empty for most certificate and letter templates. | {"title":"Certificate"} |
以下示例数据与占位符相匹配 google-docs-template.docx将其粘贴到 Document Data 文本,或将其作为文件上传到 Document Data 文件。
[
{
"name": "Alice Johnson",
"course": "Intro to Automation",
"date": "2026-03-10",
"instructor": "Mr. Smith"
}
]
输出
该操作会将生成的文档作为动态内容返回。将其映射到任何接受文件内容的下游步骤。
| 场地 | 类型 | 它包含什么 |
|---|---|---|
Doc Data | Binary | The merged document produced from the Google Docs export and your data. Map it into File Content of Create file (Dropbox, OneDrive, SharePoint) or into an Outlook attachment. |
File Name | String | Output filename derived from Template Name. Combine it with an expression such as guid() when you want unique filenames per run. |

保存结果:将生成的文档映射到 File Content并使用 guid() 在 File Name 用于生成唯一的输出名称。
生产模式
适用于 Google Docs 模板的常见 Power Automate 模式Replace the manual test with these once the sample works.
- Microsoft 表单:当提交新的响应时,触发器会触发。
- 生成文档单映射 Google Docs 证书 .docx 从获取文件内容。
- 响应字段以如下方式传递: JSON 在 Document Data 文本。
- 创建文件保存证书, Outlook 发送电子邮件即可送达。
- SharePoint 当列表中创建项目时,会触发该事件。
- 生成单个文档会将列表列合并到模板中。
- 生成的文档将作为动态内容返回。
- SharePoint 创建文件会将其存储在文档库中。
- 手动触发流程即可开始运行。
- 使用内联方式生成包含单个地图的文档 google-docs-template.docx JSON。
- 创建文件并写入 /pdf4meoutput,文件名使用 guid()。
- 确认无误后,将手动扳机更换为真正的扳机。
常见问题解答
相关指南
有关底层模板引擎,请参阅 亚斯 Words 为了 .NET 文档 以及 Power Automate 表达式引用。