跳到主要内容

Google Docs 模板 Power Automate

Google Docs 家庭 是一个 Power Automate 生成文档:使用模板设计的单个选项 Google Docs 并导出为 .docx将该文件映射到“生成单个文档”中,并将其与您的文件合并。 JSON 或者 XML 数据,并获得个性化信息 PDF 或者 Word 文件返回。当您的团队编写模板时,请选择它。 Google Docs 而不是 Microsoft Word

相关博客文章
目前尚无关于此功能的博客文章——敬请期待。
在此期间,您可以浏览 PDF4me 博客,查看适用于各平台的教程和工作流程。
访问博客

开始之前

Google Docs 导出为 .docx
设计模板 Google Docs添加占位符,然后下载。 Microsoft Word.docx样本 google-docs-template.docx 已经导出并准备就绪。
匹配数据文件
使用 google-docs-data.json (受到推崇的), test.xml, 或者 测试.csv模板中的占位符名称与数据键相匹配。
PDF4me 连接 Power Automate
创建一个 PDF4me 连接 Power Automate 并粘贴你的 API 密钥。同一个密钥适用于所有…… PDF4me 对您的租户采取行动。

示例文件包

请下载以下文件。 Google Docs 模板加上匹配数据 JSONXML, 和 CSV绘制地图 .docxSharePointOneDrive, 或者 Dropbox 生成单个文档。

PDF4me 在 Power Automate 中生成 Word 文档的单次操作,模板文件类型设置为 Docx,模板文件名设置为 linq-template.docx,模板文件数据映射自 Dropbox 文件内容,文档数据类型为 JSON,文档数据文本包含示例 JSON。

目标配置 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 账户,使用 使用模板生成文档 反而。

范围必需的它的作用例子
ConnectionRequiredPDF4me connection for the flow. Create one with your API key, then reuse it across every PDF4me action.My PDF4me connection
Template File TypeRequiredFormat of the template file. A Google Docs export is a .docx, so choose PDF4me Word Template (Docx).PDF4me Word Template
Output TypeRequiredFormat of the generated document. PDF for a locked layout, or Word for an editable .docx.PDF
Template NameRequiredFilename of the exported template including the .docx extension. Map from the prior Get file step.google-docs-template.docx
TemplateRequiredBinary content of the Google Docs export. Map File Content from SharePoint, OneDrive, or Dropbox Get file content.File Content
Document DataTypeRequiredFormat of the data payload. Json maps cleanly from SharePoint columns and Forms. Xml is for XML source systems.Json
Document Data TextConditionalInline data payload built from dynamic content. Required when Document Data File is empty.[{ "name": "Alice Johnson" }]
Document Data FileConditionalA JSON or XML data file mapped from a prior step. Required when Document Data Text is empty.1. Data
Meta Data JsonOptionalDocument 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 DataBinaryThe 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 NameStringOutput filename derived from Template Name. Combine it with an expression such as guid() when you want unique filenames per run.
在 Power Automate 中使用 Dropbox 创建文件操作,文件夹路径设置为 pdf4meoutput,文件名由 guid() 加上生成的文档组成,文件内容映射到生成的文档。

保存结果:将生成的文档映射到 File Content并使用 guid()File Name 用于生成唯一的输出名称。

生产模式

适用于 Google Docs 模板的常见 Power Automate 模式Replace the manual test with these once the sample works.
表格回复证书
  1. Microsoft 表单:当提交新的响应时,触发器会触发。
  2. 生成文档单映射 Google Docs 证书 .docx 从获取文件内容。
  3. 响应字段以如下方式传递: JSONDocument Data 文本。
  4. 创建文件保存证书, Outlook 发送电子邮件即可送达。
SharePoint 列表到已存储的 PDF
  1. SharePoint 当列表中创建项目时,会触发该事件。
  2. 生成单个文档会将列表列合并到模板中。
  3. 生成的文档将作为动态内容返回。
  4. SharePoint 创建文件会将其存储在文档库中。
手动测试 Dropbox
  1. 手动触发流程即可开始运行。
  2. 使用内联方式生成包含单个地图的文档 google-docs-template.docx JSON
  3. 创建文件并写入 /pdf4meoutput,文件名使用 guid()。
  4. 确认无误后,将手动扳机更换为真正的扳机。

常见问题解答

How do I prepare a Google Docs template for Power Automate?+
Design the document in Google Docs, add placeholders, then use File, Download, Microsoft Word (.docx). Map that file into Generate Document Single from SharePoint, OneDrive, or Dropbox. If the template is already saved in your PDF4me account, use Generate Document Using Template instead.
Which Template File Type do I select for a Google Docs export?+
Set Template File Type to PDF4me Word Template. A Google Docs export is a .docx, so it merges through the Word template engine. Set Output Type to PDF or Word.
Can the action output PDF or Word from a Google Docs template?+
Yes. Set Output Type to PDF or Word on Generate Document Single. The exported Google Docs file is a .docx, so either output format is valid.
What data formats can I use with the Google Docs template?+
Set Document DataType to Json or Xml. Document Data Text takes an inline payload built from dynamic content, and Document Data File takes an uploaded JSON or XML file. The sample pack includes google-docs-data.json, test.xml, and test.csv.
Where does the generated file go in a Power Automate flow?+
The action returns Doc Data as dynamic content. Map it into a downstream step such as Create file (Dropbox, OneDrive, SharePoint) or Outlook Send an email with attachment. Use guid() in the File Name to keep each output unique.

相关指南

有关底层模板引擎,请参阅 亚斯 Words 为了 .NET 文档 以及 Power Automate 表达式引用