Adobe PDF Services Document Generation
On request (from a Power App or approval), the flow merges Dataverse data into a template and uses Adobe PDF Services to generate a branded PDF (contract, statement, certificate), stores it in SharePoint, and emails it to the recipient. Optionally combines multiple PDFs and applies a password. Centralizes high-fidelity document generation.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow generates high-fidelity, branded PDFs with Adobe PDF Services Document Generation. On request (from a Power App or an approval flow), it reads a request row from Dataverse, merges its fields into a tagged Word template, renders a polished PDF, stores it in SharePoint, optionally password-protects it, and emails it to the recipient with a share link.
Why it matters: Native Power Automate has limited document-generation fidelity. Adobe PDF Services produces pixel-accurate, print-ready output and supports merge / protect / combine operations — ideal for customer-facing contracts, statements and certificates.
Build note (as-built): The Adobe PDF Services connector action exposes its input file as a multipart contentOnly parameter that cannot be authored through the deployment API, so — consistent with every other FlowLibs Adobe build — all Adobe calls use the built-in HTTP action against the Adobe PDF Services REST API (token -> asset -> upload -> operation -> poll -> download). Built-in HTTP needs no connection reference, so the only connections to authorize are SharePoint, Outlook and Dataverse.
Use Case
Teams that issue contracts, statements, or certificates want branded PDFs generated on demand from CRM data, archived, and delivered automatically — with optional password protection for sensitive documents. A Power App (or an approval flow) calls this flow with the Dataverse requestId; the flow does the rest and returns the file URL.
Flow Architecture
When a Document Is Requested
Request (HTTP) triggerBody { requestId (required Dataverse row id), recipientEmailOverride? }. A Power App or approval flow POSTs to the trigger URL.
Initialize variables
Initialize Variable (x14)Mint a guid() correlation id and surface every environment variable (site, template path, output folder/library, Adobe base, protect flag, password, poll interval) plus loop state (status, download URI, asset id, poll URL).
Get DocGen Request
Microsoft Dataverse — GetItemRead the request row (flowlibs_docgenrequests, key = requestId) for the merge data.
Compose Merge Data
ComposeBuild the JSON merge payload (template tag values) from the record fields.
Get Template
SharePoint — GetFileContentByPathRead the tagged Word template (docx) by server-relative path.
Adobe Get Token
HTTP — Adobe IMS tokenExchange client id/secret for an Adobe access token.
Adobe Create Asset
HTTP — POST /assetsCreate an asset placeholder and get a pre-signed upload URI.
Adobe Upload Template
HTTP — PUT uploadUpload the template bytes to the pre-signed URI.
Adobe Start DocGen
HTTP — POST /operation/documentgenerationStart the Document Generation job (template + JSON data -> PDF).
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_AdobeClientId | String | <configure> | Adobe API client id (also sent as x-api-key). (reused) |
| flowlibs_AdobeClientSecret | String | <configure> | Adobe API client secret. (reused) |
| flowlibs_AdobePdfServicesBase | String | https://pdf-services.adobe.io | Adobe PDF Services REST base URL. (reused) |
| flowlibs_SharePointSiteURL | String | https://your-tenant.sharepoint.com | SharePoint site holding the template + output library. (reused) |
| flowlibs_DocGenTemplatePath | String | /FlowLibs - DocGen Templates/document-template.docx | Server-relative path to the tagged Word template. (new) |
| flowlibs_DocGenOutputFolderPath | String | /FlowLibs - Generated Documents | Server-relative folder for generated PDFs (CreateFile). (new) |
| flowlibs_DocGenOutputLibraryName | String | FlowLibs - Generated Documents | Library display name for CreateSharingLink. (new) |
| flowlibs_ProtectDocuments | String | false | When true, password-protect the PDF via Adobe ProtectPDF. (new) |
| flowlibs_PdfPassword | String |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Microsoft Dataverse | shared_commondataserviceforapps | GetItem UpdateRecord |
| SharePoint | shared_sharepointonline | GetFileContentByPath CreateFile CreateSharingLink |
| Office 365 Outlook | shared_office365 | SendEmailV2 |
| HTTP | http | POST /token |
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Combine cover/terms pages
- Add an Adobe CombinePDF step (upload a cover PDF as a second asset, then /operation/combinepdf with both asset ids) before storing. Adobe combinepdf accumulates a [{assetID}] array.
- Robust polling
- The demo uses a fixed poll interval; for large documents raise flowlibs_AdobePollIntervalSeconds or widen the Until limits.
- Secret management
- Store flowlibs_PdfPassword and the Adobe secret in Azure Key Vault and read them via the Key Vault connector instead of plain env vars.
- Dynamic tables
- Pass line-item arrays into Compose Merge Data for invoices/statements (Adobe Document Generation supports table loops in the template).
- e-sign chain
- Hand the generated PDF to DocuSign / Adobe Sign for signature after generation.
- Batch
- Replace the Request trigger with a Recurrence + Dataverse ListRecords (status = Pending) loop to mass-generate.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Merge payload (template data)
Bound to the DocGen jsonDataForMerge body property.
EXPR.02Adobe job poll URL
Read the polling Location header (case-insensitive).
EXPR.03Async completion gate (Until)
Exit the Until loop when the job is done.
EXPR.04Signed download URI
Pre-signed download URI for the generated PDF.
EXPR.05Protect gate
Branch to the protect path when protection is enabled.
EXPR.06Final PDF -> storage/email
Binary for CreateFile; varFinalPdfBase64 is the attachment ContentBytes.
EXPR.07Recipient
Use the override email if supplied, else the request row email.
EXPR.08Share link
Organization view-only sharing link URL.
Customize & download
Generate a ready-to-import copy of this solution with your environment-variable values baked in — available on Base, Pro, or Team.
Upgrade to customize
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.