Generate Document Using Microsoft Word Template

Definition

The Generate Document Using Microsoft Word Template action allows you to automate the creation of documents based on Microsoft Word templates stored in OneDrive. This action supports advanced document generation tasks, such as filling placeholders, mapping data, inserting images, and creating tables. Additionally, you can generate a PDF version of the document.

Use Cases

The Generate Document Using Microsoft Word Template action is ideal for:

  1. Generating Contracts: Populate templates with client and deal-specific details to create contracts.
  2. Invoice Creation: Automate the generation of invoices by mapping customer data to placeholders.
  3. Report Generation: Dynamically generate reports with data, images, and tables for analysis and presentation.
  4. Certification Automation: Create and distribute certificates by merging user-specific data into predefined templates.
  5. Letter Creation: Automate personalized letter generation, including official correspondence or invitations.

Inputs

  1. Connection:

Authorizes Zenphi to interact with OneDrive on your behalf. It allows access to retrieve the template and upload generated files.

How to Create a OneDrive Connection:

Navigate to Zenphi Connections settings.

Click New Connection and select Microsoft OneDrive.

Follow the prompts to authorize Zenphi to access your OneDrive account.

Template File:

  1. Select By Path: Indicates whether you’ll select the file by path or ID.
  2. File ID (or File Path): The identifier or path of the Microsoft Word template file in OneDrive.

Destination File:

  1. File Name: Specify the name of the new file to be created in OneDrive.
  2. Select Destination Folder By Path: Choose whether to select the destination folder by path or ID.
  3. Destination Folder ID (or Destination Folder Path): The identifier or path of the folder where the generated file will be saved.
  4. Generate PDF:

Indicate whether to create a PDF version of the document alongside the Word file.

  1. Load Placeholder:

Enables the loading of placeholders within the template for dynamic content insertion.

  1. Placeholder Mapping:

Map specific placeholders in the template to their respective dynamic values.

  1. Image Mapping:

Define how images should be inserted into specific placeholders in the template.

  1. Table Mapping:

Set up tables dynamically based on data sources, such as lists or arrays.


Outputs

The action produces detailed outputs for both the Word and PDF files, providing extensive control and visibility:

Microsoft Word Outputs

  1. Microsoft Word File Content:

The binary content of the generated Word file.

  1. Microsoft Word File ID:

A unique identifier for the Word file in OneDrive.

  1. Microsoft Word File Name:

The name of the generated Word file.

  1. Microsoft Word File Path:

The full path to the Word file in OneDrive.

  1. Microsoft Word File Web URL:

A web-accessible URL for viewing the Word file in OneDrive.

  1. Microsoft Word File Download URL:

A pre-authenticated URL for downloading the Word file directly.

  1. Microsoft Word File Size:

The size of the generated Word file in bytes.

PDF Outputs

  1. PDF File Content:

The binary content of the generated PDF file.

  1. PDF File ID:

A unique identifier for the PDF file in OneDrive.

  1. PDF File Name:

The name of the generated PDF file.

  1. PDF File Path:

The full path to the PDF file in OneDrive.

  1. PDF File Web URL:

A web-accessible URL for viewing the PDF file in OneDrive.

  1. PDF File Download URL:

A pre-authenticated URL for downloading the PDF file directly.

  1. PDF File Size:

The size of the generated PDF file in bytes.


Step-by-Step Guide

Step 1: Add the Action

Drag and drop the Generate Document Using Microsoft Word Template action from the Microsoft OneDrive category into your Zenphi workflow.

Step 2: Configure Inputs

Connection: Select or create a OneDrive connection.

Template File: Choose the template file by ID or path.

Destination File:

Provide a file name for the generated document.

Specify the destination folder by ID or path.

Optional Fields: Configure additional options like PDF generation, placeholder, image, and table mappings as needed.

Step 3: Test the Configuration

Run the flow in test mode to ensure the document is generated correctly.

Verify that placeholders are replaced with the correct values and that the document is saved in the specified OneDrive folder.

Step 4: Publish and Automate

Once tested, publish the flow.

Trigger the action automatically based on predefined events or conditions, such as form submissions or scheduled tasks.


Example

Automating Invoice Generation

Trigger: When a new order is placed, a webhook triggers the flow.

Template File: A pre-designed invoice template is selected from OneDrive.

Mappings:

Placeholder Mapping: Order details like customer name, item descriptions, and total amounts.

Image Mapping: Company logo.

Table Mapping: Order item details.

Outputs:

The generated invoice is saved as a Word file and PDF in the "Invoices" folder.

A public link to the PDF is emailed to the customer.

By leveraging Zenphi’s Generate Document Using Microsoft Word Template action, you can simplify document creation processes, enhance productivity, and maintain consistency in your documentation workflows.