web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

[Power Automate] Populate a Microsoft Word Template - Table of Content

(3) ShareShare
ReportReport
Posted on by 8

Hello everyone,

I’m trying to generate documents using a Word Template (.docx) in Power Automate, and I need the final document to include a Table of Contents (TOC) that is automatically updated based on the headings (Heading 1) that I send from the flow.

However, I’m running into several issues:

  • When I send text that should appear as Heading 1, the Word template does not update the TOC.
  • Even after converting the generated file to PDF, the TOC still shows outdated entries.
  • I tried using HTML with <h1>, but the Word Template does not convert these tags into Word heading styles.
  • I also tried several common suggestions from the community (Rich Text Content Controls, HTML-to-text conversions, etc.), but none of them cause the TOC to refresh automatically.
At this point, I’m not finding any supported way to generate a document from a Word Template (.docx), insert headings dynamically, and end up with a correctly updated Table of Contents, either in the DOCX or in the final PDF.
Any guidance or working solutions would be greatly appreciated.
I have the same question (0)
  • Verified answer
    ManoVerse Profile Picture
    940 Super User 2026 Season 1 on at
    you are right there is no direct method currently which will update TOC while working with word template. It can be done with some paid service connectors options like Power2Apps or PDF4me , both are paid connector and can suffice your requirement.
    If you want to go free then there is effort for development  with Open XML + office scripts (no license needed) but this wont be using word template. you have to generate DOCX using OpenXML (in Azure Function or local script) -> build the document programmatically , insert real word heading styles ( h1, h2 , etc)  -> Add TOC field -> Refresh TOC using office scripts.
    OpenXML builds the file, and Office Scripts uses the actual Word engine to refresh the TOC. But yes there is development efforts required for this method.
     
    I dont think any other supported way as of now for TOC refresh. 
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 176

#2
ManoVerse Profile Picture

ManoVerse 56 Super User 2026 Season 1

#3
Niki Patel Profile Picture

Niki Patel 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans