Generate Document from Word in Power Automate
PDF4me Generate Document from Word action automates report and form creation using Word templates in Power Automate, transforming dynamic data collections from JSON or XML sources into professional documents. This powerful mail merge capability enables bulk document generation from database queries, SharePoint lists, and Excel spreadsheets across Microsoft 365 workflows.
Authenticating Your API Request
To access the PDF4me Web API through Power Automate, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user, enabling seamless integration between your Power Automate flows and PDF4me's powerful document generation services.

Key Features
- Word Template Support: Generate documents from DOCX templates with merge fields
- Multi-Format Data: Accept JSON and XML data sources for template population
- Bulk Generation: Create multiple documents from data collection lists automatically
- Dynamic Field Mapping: Map template variables to flow data with field metadata
- Flexible Output: Choose output formats including PDF, Word, Excel, and HTML
Parameters
Complete list of parameters for the Generate Document from Word action. Configure these parameters to control document generation.
Important: Parameters marked with an asterisk (***) are required and must be provided for the action to function correctly.
| Parameter | Type | Description | Example |
|---|---|---|---|
| Template File Data*** | Binary | Word Template Content • Map Word template file from previous action output • Supports DOCX files with merge fields or mustache syntax • Can be retrieved from SharePoint, OneDrive, or email attachments • Template should contain properly formatted merge fields | [File Content from Get File] |
| Template File Name*** | String | Template File Identifier • Specify file name with .docx extension • Used for processing and output naming • Should match source template file name • Accepts dynamic values from flow variables | ReportTemplate.docx |
| Input Data Type | Option | Data Format Selection • JSON - Use JSON formatted data for template • XML - Use XML formatted data for template • Determines how data is parsed and mapped to fields • Default is JSON if not specified | JSON |
| Data String*** | String | Template Data Content • Provide JSON or XML data for template population • Can be static content or dynamic from previous actions • Must match selected Input Data Type format • Supports data from Excel, databases, SharePoint, APIs | {"name":"John","total":1500} |
| Field Metadata | String | Additional Field Configuration • Optional metadata in JSON format for advanced field mapping • Configure custom field behaviors and formatting • Specify data transformation rules • Define conditional field display logic | {"dateFormat":"MM/DD/YYYY"} |
| Output Type | Option | Generated Document Format • PDF - Output as PDF document • Word - Output as Word document • Excel - Output as Excel spreadsheet • HTML - Output as HTML file | PDF |
Output
The PDF4me Generate Document from Word action returns comprehensive output data for seamless Power Automate flow integration:
- Table
- JSON
- Flow Integration
Table View
Response data in a structured table format:
| Parameter | Type | Description |
|---|---|---|
| Output Documents | Array of Objects | Array containing all generated documents from the template |
| File Name | String | Name of each generated output file |
| File Content | Binary | Binary content of each generated document for downstream actions |
JSON Response Format
{
"Output Documents": [
{
"File Name": "Report_001.pdf",
"File Content": "[Binary Content]"
},
{
"File Name": "Report_002.pdf",
"File Content": "[Binary Content]"
}
]
}
Power Automate Flow Usage
Use generated documents in subsequent actions:
- Email Distribution: Send generated reports to recipients via Outlook
- SharePoint Storage: Save documents to SharePoint document libraries
- OneDrive Backup: Store documents in OneDrive for Business folders
- Teams Sharing: Post generated documents to Teams channels
- Database Logging: Record document metadata in SQL or Dataverse
- Approval Workflows: Route documents for manager approval
Workflow Examples
The PDF4me Generate Document from Word action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:
- Sales Reports
- HR Contracts
- Invoice Generation
- Customer Letters
Automated Monthly Sales Report Generation
Transform your sales reporting with automated report creation from Dynamics 365 data:
Complete Workflow Steps:
- Trigger: Scheduled trigger on last day of month at 8 PM
- Get Sales Data: Query Dynamics 365 for monthly sales by region
- Format JSON: Convert sales data to JSON format for template
- Get Template: Retrieve sales report Word template from SharePoint
- Generate Reports: Create PDF reports for each sales region
- Save Reports: Store generated PDFs in SharePoint Reports library
- Email Managers: Send region-specific reports to sales managers
- Create Summary: Generate executive summary with all regional data
Business Benefits:
- Generates 12 regional sales reports automatically each month
- Eliminates 8 hours of manual report creation time monthly
- Ensures consistent report formatting across all regions
- Delivers real-time sales insights within 5 minutes of month-end
Automated Employment Contract Generation
Streamline your HR onboarding with automated contract creation from employee data:
Complete Workflow Steps:
- Trigger: New hire record created in HR system or SharePoint
- Get Employee Data: Retrieve employee name, role, salary, start date
- Get Contract Template: Fetch appropriate contract template from library
- Generate Contract: Create personalized contract with employee details
- Add Signatures: Insert digital signature fields for signing
- Save to OneDrive: Store contract in employee's OneDrive folder
- Email HR: Send contract copy to HR team for review
- Trigger DocuSign: Send contract for electronic signature collection
Business Benefits:
- Generates 50+ employment contracts monthly automatically
- Reduces contract preparation time from 2 hours to 2 minutes
- Eliminates manual data entry errors in contracts
- Accelerates onboarding process by 3 days per employee
Automated Invoice Document Creation
Optimize your billing process with automated invoice generation from order data:
Complete Workflow Steps:
- Trigger: Order marked as "Shipped" in order management system
- Get Order Details: Retrieve order items, pricing, customer info
- Calculate Totals: Compute subtotal, tax, shipping, total amount
- Get Invoice Template: Fetch company invoice Word template
- Generate Invoice: Create PDF invoice with order details
- Add Invoice Number: Assign sequential invoice number from list
- Email Customer: Send invoice PDF to customer email address
- Store Archive: Save invoice copy to SharePoint accounting folder
Business Benefits:
- Generates 500+ invoices daily without manual intervention
- Reduces invoicing errors by 95% with automated data population
- Accelerates cash flow with instant invoice delivery
- Maintains complete invoice audit trail in SharePoint
Automated Customer Communication Letters
Enhance customer engagement with personalized letter generation from CRM data:
Complete Workflow Steps:
- Trigger: Customer status changed to "VIP" in Dynamics 365
- Get Customer Data: Retrieve customer name, history, preferences
- Select Template: Choose appropriate letter template based on type
- Generate Letter: Create personalized Word letter with customer details
- Convert to PDF: Transform letter to PDF for professional delivery
- Add Company Logo: Embed company branding elements
- Email Customer: Send personalized letter via Outlook
- Log Activity: Record communication in CRM customer timeline
Business Benefits:
- Sends 200+ personalized customer letters weekly automatically
- Increases customer satisfaction scores by 35% with personalization
- Saves 15 hours weekly on customer communication tasks
- Maintains consistent brand messaging across all letters
Industry Use Cases & Applications
- Finance & Banking
- Healthcare & Medical
- Legal & Professional Services
- Education & Training
Finance & Banking Use Cases
- Loan Documents: Generate loan agreements from application data
- Account Statements: Create personalized account statements for customers
- Compliance Reports: Produce regulatory compliance documents automatically
- Credit Letters: Generate credit approval/denial letters with details
Healthcare & Medical Use Cases
- Patient Reports: Create medical reports from patient data systems
- Discharge Summaries: Generate discharge documentation for patients
- Insurance Forms: Populate insurance claim forms automatically
- Lab Results: Create formatted lab result reports for distribution
Legal & Professional Services Use Cases
- Legal Contracts: Generate client contracts from case management data
- Case Documents: Create legal briefs and filings automatically
- Client Letters: Produce personalized client communication letters
- Billing Statements: Generate detailed legal billing statements
Education & Training Use Cases
- Certificates: Create course completion certificates for students
- Report Cards: Generate student performance reports from LMS data
- Enrollment Letters: Produce enrollment confirmation documents
- Transcripts: Create formatted academic transcripts automatically