Skip to main content

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.

Generate Document from Word Power Automate

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.

ParameterTypeDescriptionExample
Template File Data***BinaryWord 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***StringTemplate 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 TypeOptionData 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***StringTemplate 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 MetadataStringAdditional 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 TypeOptionGenerated 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 View

Response data in a structured table format:

ParameterTypeDescription
Output DocumentsArray of ObjectsArray containing all generated documents from the template
File NameStringName of each generated output file
File ContentBinaryBinary content of each generated document for downstream actions

Workflow Examples

The PDF4me Generate Document from Word action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:

Automated Monthly Sales Report Generation

Transform your sales reporting with automated report creation from Dynamics 365 data:

Complete Workflow Steps:

  1. Trigger: Scheduled trigger on last day of month at 8 PM
  2. Get Sales Data: Query Dynamics 365 for monthly sales by region
  3. Format JSON: Convert sales data to JSON format for template
  4. Get Template: Retrieve sales report Word template from SharePoint
  5. Generate Reports: Create PDF reports for each sales region
  6. Save Reports: Store generated PDFs in SharePoint Reports library
  7. Email Managers: Send region-specific reports to sales managers
  8. 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

Industry Use Cases & Applications

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

Get Help