1. Home
  2. Guides
  3. Power Automate
  4. How to generate Word documents from Excel and Microsoft Forms with Power Automate
Power Automate

How to generate Word documents from Excel and Microsoft Forms with Power Automate

Build a document generator that takes a short Microsoft Form, looks up the full record in Excel, and creates a formatted, editable Word document that is emailed to you. It uses standard Microsoft 365 connectors only.

  • By Nur Islam
  • 21:43 video
  • 14 steps
  • 1.7K views
Jump to a step (14)
Who this is for

Property managers, HR and office admins retype the same tenant, client or employee details into Word every time they need an agreement or letter. It is slow and easy to get a name, date or rent amount wrong. The usual automation (Populate a Microsoft Word template) is a premium action, and most free tutorials need SharePoint.

In the video I build a residential lease renewal agreement because it covers dates, currency values and a calculated date in one example. You pick the tenant in Microsoft Forms and enter only what is new: the renewal rent, the new lease end date and any extra terms. Power Automate finds the tenant in Excel, drops every value into an HTML version of the Word template, saves it to OneDrive as a .doc file that opens in Word, emails it to you and writes the new rent and end date back to Excel.

The trick is that Word reads HTML. You turn your Word template into HTML once (ChatGPT does this for you), keep it in a single Compose action, and replace the placeholders with dynamic values. There is no template file to manage and no content controls.

What you need

  • Microsoft 365 Business Basic or Standard (standard Power Automate connectors only)
  • An Excel table in OneDrive for Business with a unique ID column (the demo uses Tenant ID)
  • A Microsoft Form with a record drop-down, the ID, and the new values for the document
  • Your Word document with the changing values highlighted in yellow
  • ChatGPT, Claude or another AI tool to turn the Word document into HTML
  • A OneDrive folder for the generated documents

Step by step

0 of 14 done
  1. 01

    Prepare the Word template

    Open the Word document you want to generate and highlight in yellow every value that changes per record. In the demo that is the agreement date, tenant name, address, unit, dates, rents, deposit, parking, pet terms and utilities.

    Everything else (header, section wording, tables, terms, signature area) stays the same every time.

  2. 02

    Set up the Excel database as a table

    Give each record a unique ID column. Power Automate uses it to find the right row. The demo tenant database has Tenant ID, Tenant Name, Email, Property Address, Unit, City, State, Zip, Current Rent, Lease Start Date, Lease End Date, Security Deposit, Parking, Pet Terms and Utilities Included.

    Select the data, choose Format as Table and pick a style. Under Table Design you can see the table name (Table1 in the video). Add or remove columns to suit your own document.

  3. 03

    Build the Microsoft Form

    Create a form that asks only for what is new:

    • A choice question set to a drop-down to pick the tenant
    • Tenant ID as a text field
    • Renewal Monthly Rent as a text field
    • New Lease End Date as a date field
    • Additional Renewal Terms as a long text field

    The person reads the ID in the drop-down option and types it in the Tenant ID field. You could pull the ID out of the drop-down value with an expression instead, but the separate field keeps the flow simple.

  4. 04

    Fill the drop-down from Excel with CONCAT

    In a helper column in Excel, combine the ID, name, property and unit with CONCAT, separated by dashes, for example =CONCAT([@[Tenant ID]]," - ",[@[Tenant Name]]," - ",[@[Property Address]]," - ",[@Unit]).

    Copy the whole helper column and paste it into the Forms choice question. Forms creates one option per line, so you do not type them one by one. Then switch the question to a drop-down.

  5. 05

    Create the automated cloud flow

    In Power Automate select Create > Automated cloud flow. Name it (the demo uses Tenant Lease Renewal Agreement), search for Forms and choose the trigger When a new response is submitted. Select your form in Form Id.

  6. 06

    Get the response details

    Add the Microsoft Forms action Get response details. Select the same form, and for Response Id choose the Response Id output from the trigger. This gives you the actual answers.

  7. 07

    Find the record in Excel with Get a row

    Add Get a row from Excel Online (Business).

    • Location: OneDrive for Business
    • Document Library: OneDrive
    • File: your tenant database
    • Table: Table1
    • Key Column: Tenant ID
    • Key Value: the Tenant ID answer from Get response details

    Under Advanced parameters set DateTime Format to ISO 8601. This returns dates in a format Power Automate can work with, without a complicated conversion expression.

  8. 08

    Turn the Word template into HTML with ChatGPT

    The Power Automate action Populate a Microsoft Word template is premium, so this build uses HTML instead.

    Upload the Word document (filled with demo data, changing values in yellow) to ChatGPT or any AI tool. The prompt asks it to create a complete HTML version for Power Automate, replace each yellow highlighted value with a clear, human-readable placeholder named after the field (for example <<Tenant Name>>), use the Aptos font at size 10.6, and follow your other formatting rules.

    Open the code view and copy the HTML. It will not look like the final document in the chat, but it will once Word opens it.

  9. 09

    Paste the HTML into a Compose action

    Add a Compose action, rename it HTML Template and paste the HTML into Inputs. The whole document lives in this one action, and you replace the placeholders right where they sit.

  10. 10

    Replace the placeholders with dynamic values

    Delete each placeholder and insert the matching value. Type / and choose Insert dynamic content or Insert expression.

    • Agreement date: the form Submission time, formatted with an expression that converts it to your time zone, for example formatDateTime(convertTimeZone(<Submission time>,'UTC','Pacific Standard Time'),'MMMM d, yyyy'). Change Pacific Standard Time to your own time zone.
    • State, tenant name, property address, unit, city, zip, current rent, security deposit, parking, pet terms, utilities: from Get a row.
    • New lease start date: the current lease end date from Excel plus one day, for example formatDateTime(addDays(<Lease End Date>,1),'MMMM d, yyyy').
    • New lease end date, renewal monthly rent, additional terms: from Get response details.

    Scroll through the whole template, including the signature section, so you do not miss a placeholder. In the video I missed one property address and had to go back.

  11. 11

    Create the Word file in OneDrive

    Add the OneDrive for Business action Create file and rename it Create Word file. Pick a folder you created (the demo uses Lease Agreement Files).

    For File Name type Lease Renewal-, add the Tenant ID and Tenant Name from Excel with dashes, and end with .doc. For File Content pick the output of HTML Template.

    The file is HTML, but the .doc extension tells Word to open it. Word applies the fonts, tables and spacing and gives you a normal editable document.

  12. 12

    Email the document as an attachment

    Add Get file content (OneDrive for Business) and set File to the Id from Create Word file. You need the content to attach it.

    Then add Send an email (V2) from Office 365 Outlook. Enter the recipient, a subject and body with the tenant name, property address and unit, and reuse the same date expressions in the body. Under Advanced parameters add Attachments, set the name (tenant name, property and unit, ending in .doc) and set Attachments Content to the File Content from Get file content.

  13. 13

    Write the new values back to Excel

    Add Update a row from Excel Online (Business) with the same file, Table1, key column Tenant ID and the Tenant ID from the form as the key value.

    Under Advanced parameters pick Current Rent and Lease End Date. Set Current Rent to the renewal monthly rent from the form, and Lease End Date to the new lease end date formatted with an expression, for example formatDateTime(<New Lease End Date>,'yyyy-MM-dd').

    This runs after the row was already read, so the document still shows the old rent as the current rent. The update only affects the next renewal.

  14. 14

    Test the flow

    Save, select Test > Manually and submit the form. In the demo I pick tenant 210, enter 3500 as the new rent and 28 February 2027 as the end date.

    Check the email, download the attachment and select Enable Editing. All fields should be filled in. Edit anything you need, then print or save as PDF. Open Excel and confirm the row has the new rent and end date.

Tips and common problems

  • Populate a Microsoft Word template is a premium action. The HTML in a Compose action plus a .doc file gets you a formatted, editable Word document with standard connectors only.
  • Set DateTime Format to ISO 8601 in Get a row. Without it Excel returns dates as serial numbers that are hard to format.
  • Submission time is in UTC. Use convertTimeZone in the date expression and change Pacific Standard Time to your own time zone.
  • If the email subject or body shows extra square brackets around a value, remove them from the text around the dynamic content. It happened in the test run in the video.
  • Save the file with .doc, not .docx. The content is HTML, and Word only opens it correctly with the .doc extension. You can then save it as .docx or PDF from Word.
  • Put Update a row after the document is created, so the document uses the current rent before Excel is overwritten.
Still stuck? Ask AI to help you fix itChatGPTClaudeGeminiCopilotPerplexityGrok

How the flow is put together

StepConnector and actionWhat it does
1Microsoft Forms: When a new response is submittedStarts the flow
2Microsoft Forms: Get response detailsReads the answers
3Excel Online (Business): Get a rowFinds the record by Tenant ID (DateTime Format ISO 8601)
4ComposeHTML template with placeholders replaced
5OneDrive for Business: Create fileSaves the HTML as a .doc file
6OneDrive for Business: Get file contentReads the file for the attachment
7Office 365 Outlook: Send an email (V2)Emails the document
8Excel Online (Business): Update a rowWrites the new rent and end date back

Need a PDF instead of a Word file? See Convert Microsoft Forms responses to PDF and email them.

Questions

Can I generate a Word document from Microsoft Forms without a premium Power Automate license?

Yes. This flow uses only Microsoft Forms, Excel Online (Business), OneDrive for Business and Office 365 Outlook. It skips the premium Populate a Microsoft Word template action and writes an HTML file with a .doc extension that Word opens as a normal document.

Do I need SharePoint to fill a Word template with Power Automate?

Not with this method. The Excel database and the generated documents live in OneDrive for Business, and the template is HTML inside a Compose action, so there is no SharePoint library or Quick Parts setup.

Why does the generated file end in .doc instead of .docx?

The file content is HTML. The .doc extension tells Word to open it, and Word reads the HTML and applies the formatting. Once it is open you can save it as .docx or PDF.

Can I use this for offer letters or service agreements?

Yes. The flow stays the same. Change three things: your Excel file (keep a unique ID column), your template (highlight the changing values and run it through the same prompt), and your form (ask only for what is new).

Video chapters
Ask a question in the comments Last checked 26 Sep 2026. Screens change: if a step looks different, tell me in the comments.