Lewati ke konten utama

Hasilkan Dokumen Tunggal di Power Automate

Apa yang dilakukan oleh tindakan ini?

PDF4me Hasilkan Dokumen Tunggal menggabungkan sebuah Word, HTML, atau PDF templat dengan JSON atau XML data di dalam Power Automate alur dan menghasilkan yang dipersonalisasi PDF, Word, Excel, atau HTML Mengarsipkan file dalam satu tindakan. Ini menggantikan proses multi-langkah. Microsoft 365 Alur penggabungan surat dengan satu langkah yang dapat dikonfigurasi. Petakan file templat dari mana saja. Microsoft 365 tindakan penyimpanan (SharePoint, OneDrive, Dataverse, Outlook lampiran), berikan data Anda dari konten dinamis atau file yang dipetakan, dan salurkan yang dihasilkan Tanggal Dokumen langsung ke Buat file, Kirim email, atau tindakan selanjutnya.

Postingan Blog Terkait(1)

Memverifikasi Identitas Anda API Meminta

Yang PDF4me Hubungkan konektor di Power Automate memerlukan validitas koneksi memegangmu PDF4me API kunci. Buat koneksi sekali pada saat perancangan alur, lalu setiap PDF4me Tindakan di penyewa Anda menggunakannya kembali.

Fakta Penting yang Tidak Boleh Anda Lewatkan

Tipe File Templat harus sesuai dengan ekstensi templat.
Menu tarik-turun Tipe File Templat (PDF4me Templat Word, PDF4me HTML Templat, PDF4me PDF Template) harus sesuai dengan file yang dipetakan di bawah Template. File .docx yang dipetakan dengan HTML dipilih karena tipe tersebut gagal saat dijalankan. Templat Word menggunakan placeholder bergaya kumis seperti {{nama pelanggan}}.
Berikan Data Dokumen dalam bentuk Teks atau File Data Dokumen.
Teks Data Dokumen menerima data sebaris. JSON atau XML Dibangun dari konten dinamis. File Data Dokumen menerima file data biner dari sebelumnya. Microsoft 365 langkah. Berikan salah satu, bukan keduanya, di setiap alur.
Data Dokumen adalah keluaran konten dinamis.
File yang dihasilkan akan tampak seperti ini: Tanggal Dokumen kolom konten dinamis. Teruskan langsung ke SharePoint Buat berkas, Outlook Kirim email dengan lampiran, OneDrive Buat berkas, Dataverse, tambahkan baris baru, atau Teams, kirim pesan dengan berkas.
Tindakan PDF4me Generate Document Single dikonfigurasi dalam alur Power Automate dengan Tipe File Templat diatur ke Templat Word PDF4me, Tipe Output diatur ke PDF, dan templat Word yang dipetakan dari SharePoint.

Tindakan Hasilkan Dokumen Tunggal dalam sebuah Power Automate alur. Tipe File Templat, Tipe Output, Nama Templat, Templat, Tipe Data Dokumen, dan Teks Data Dokumen (atau File Data Dokumen) adalah bidang yang diperlukan untuk konversi Word ke...PDF berlari.

Parameter

Diperlukan: Tipe File Templat, Tipe Keluaran, Nama Templat, Templat, Tipe Data Dokumen. Bersyarat: Teks Data Dokumen ATAU File Data Dokumen (salah satu dari keduanya harus membawa muatan data). Opsional: Metadata JSON.

ParameterDiperlukanApa fungsinya?Contoh
Template File TypeYesFormat of the template file. PDF4me Word Template (.docx, mustache template variables, most common), PDF4me HTML Template (.html), or PDF4me PDF Template (.pdf, form field replacement).PDF4me Word Template
Output TypeYesFormat of the generated document. Word (editable .docx), PDF (locked layout, most common), Excel (.xlsx), or HTML.PDF
Template NameYesFilename of the template including extension. Map as dynamic content from the prior step File Name output (SharePoint, OneDrive, Outlook attachments).invoice_template.docx
TemplateYesBinary content of the template file. Map as dynamic content from the prior step File Content output (SharePoint Get file content, OneDrive Get file content, Outlook Get attachments).@triggerOutputs()?['body']
Document Data FileConditionalBinary data file produced by an upstream step. Use when the data lives in a file (SharePoint json file, OneDrive xml file). Required when Document Data Text is not provided.@outputs('Get_data_file')?['body']
Document DataTypeYesFormat of the data payload. Json (most common in Power Automate, maps cleanly from SharePoint columns and Forms) or Xml (for XML-native source systems).Json
Document Data TextConditionalInline data payload built from dynamic content. Use for short JSON or XML built with Power Automate expressions. Required when Document Data File is not provided.{ "Name": "John", "Age": 16, "Birth": "2000-1-1" }
Meta Data JsonNoOptional document properties as a JSON object (title, author, subject, custom fields) for templates that reference metadata at render time. Leave empty for most invoice and contract templates.{"title":"Invoice 2024-100"}

Opsi Jenis File Templat

Templat Word PDF4me.docx dengan placeholder kumis
Opsi paling fleksibel. Mendukung placeholder seperti {{nama pelanggan}}, perulangan, kondisional, tabel, dan gambar sebaris. Terbaik untuk faktur, kontrak, sertifikat, dan surat yang dibuat di Word.
Templat HTML PDF4me.html dengan CSS inline
Gunakan saat tim Anda mengelola template email atau web. Cocok untuk pemasaran. PDFdan faktur bergaya merek yang dihasilkan dari yang sudah ada HTML.
Templat PDF PDF4meDapat diisi PDF penggantian kolom formulir
Gunakan saat Anda memiliki kolom isian dengan tata letak tetap. PDF (formulir pemerintah, peraturan, atau kepatuhan). Tindakan ini mengisi kolom formulir yang diberi nama dengan data Anda dan mengembalikan formulir yang telah diisi. PDF.

Opsi Tipe Keluaran

PDFPrint-ready locked layout
Standard choice for invoices, contracts, certificates, and statements. Attach to an Outlook email, save to a SharePoint document library, or store in a Dataverse file column.
WordEditable .docx output
Use when recipients need to edit the document (draft contracts going back for review, HR letters requiring a manual signature line).
ExcelSpreadsheet .xlsx output
Use for data-heavy templates such as financial reports. The template must be designed in Excel.
HTMLWeb-ready HTML
Use for emails or web previews. Output is a single HTML file you can embed or send through Outlook.

Keluaran

Aksi ini mengembalikan satu bundel konten dinamis. File yang dihasilkan berada di Tanggal Dokumen, siap untuk diteruskan ke hilir Microsoft 365 tindakan.

BidangJenisIsi di dalamnya
Doc DataBinaryThe generated document in the format chosen under Output Type. Pass directly into SharePoint Create file, Outlook Send an email with attachment, OneDrive Create file, Dataverse Add a new row, or Teams Post a message.
File NameStringOutput filename based on Template Name with the extension matching Output Type.

Contoh alur

Pola alur Common Power AutomateTypical ways to chain Generate Document Single into a flow.
SharePoint daftar untuk email PDF
  1. SharePoint Saat suatu item dibuat atau dimodifikasi, pemicu akan aktif pada daftar Faktur.
  2. SharePoint Fungsi "Get file content" memuat templat Word faktur dari pustaka Templat.
  3. Hasilkan Dokumen Tunggal menggabungkan templat dengan kolom item daftar sebagai JSONTipe Keluaran PDF.
  4. Outlook Kirim email yang melampirkan Data Dokumen ke pelanggan dengan isi ucapan terima kasih.
Formulir tanggapan terhadap sertifikat
  1. Microsoft Forms akan memicu penyelesaian kursus ketika respons baru dikirimkan.
  2. OneDrive Mengambil konten file akan memuat templat Word sertifikat.
  3. Generate Document Single menampilkan sertifikat sebagai PDF menggunakan respons Formulir sebagai JSON.
  4. SharePoint Fungsi Buat berkas menyimpan sertifikat di pustaka dokumen Sertifikat, dan Outlook Mengirim email akan mengirimkannya ke siswa.
Persetujuan kontrak Dataverse untuk Teams
  1. Dataverse: Saat baris ditambahkan ke Deals, pemicu akan aktif pada peluang yang berhasil ditutup.
  2. SharePoint Mengambil konten file akan memuat templat kontrak.
  3. Generate Document Single menghasilkan kontrak. PDF dari data kesepakatan.
  4. Teams Post kartu adaptif dengan jalur persetujuan mengirimkan Data Dokumen ke pemilik sah untuk ditandatangani.

Pertanyaan yang Sering Diajukan

What template file types does Generate Document Single accept in Power Automate?+
Three options under Template File Type: PDF4me Word Template (.docx with mustache template variables, most common), PDF4me HTML Template (.html for browser-rendered layouts), and PDF4me PDF Template (.pdf for form field replacement on a fillable PDF). Match the type to the extension of the file mapped under Template.
What output formats can the action produce?+
Output Type supports Word (.docx for editable output), PDF (locked layout, most common for invoices and contracts), Excel (.xlsx for spreadsheet output), and HTML for web embedding. The output format is independent of the template type, so a Word template can produce a PDF and vice versa.
How do I pass JSON data to the template in a flow?+
Set Document DataType to Json, then either paste the JSON object directly into Document Data Text (with dynamic content expressions for SharePoint columns or Forms responses) or map a data file from a previous step into Document Data File. Document Data Text is best for short payloads built inline, Document Data File for larger pre-built data documents.
Where does the generated file appear in dynamic content?+
The output is on the Doc Data dynamic-content field of the action. Pass Doc Data into SharePoint Create file, Outlook Send an email with attachment, OneDrive Create file, Dataverse Add a new row with file column, or Teams Post a message with file. The filename uses Template Name with the extension matching Output Type.
Does this work with Power Automate Desktop or only Power Automate (cloud)?+
The PDF4me Connect connector is a cloud connector available in Power Automate (the web flow designer). For desktop automation, call the same Generate Document Single REST endpoint with the HTTP action.
Can I generate multiple documents in a loop?+
Yes. Wrap Generate Document Single in an Apply to each loop over an array of records (Dataverse rows, SharePoint list items, Forms responses). The action runs once per record and returns one file per iteration. For true multi-record output in a single call use Generate Documents Multiple.
Is Meta Data Json required?+
No. Meta Data Json is optional. Use it when your template references document metadata (title, author, subject) at render time. Leave it empty for most invoice and contract templates.
How is this different from the Make, n8n, or Zapier version?+
All four platforms call the same PDF4me Generate Document Single backend. Power Automate is the Microsoft 365 native option with built-in SharePoint, Outlook, Teams, and Dataverse connectors. Make is the visual scenario builder, n8n is the developer-friendly self-hosted option, Zapier triggers from any of 6,000+ SaaS apps. The template logic and output formats are identical across platforms.

Tindakan terkait

Tugas yang sama di platform lain

Dapatkan Bantuan