Skip to main content

Update Table of Contents in Power Automate

PDF4me Update Table of Contents action enables updating or creating Table of Contents in Word documents in Power Automate with comprehensive formatting options and professional styling capabilities. This powerful TOC management feature supports automatic detection of existing TOC fields, customizable heading levels, hyperlink support, tab leader control, text case options, and culture localization with full control over TOC appearance and functionality, perfect for document navigation, professional formatting, and automated TOC generation 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 Word TOC management services.

Update Table of Contents Power Automate

Key Features

  • Automatic TOC Detection: Finds and updates existing TOC fields or creates new ones
  • Customizable Heading Levels: Control which heading levels to include (1-6)
  • Hyperlink Support: Enable or disable clickable links in the TOC
  • Tab Leader Control: Show or hide dots between text and page numbers
  • Text Case Options: Use uppercase or preserve original case
  • Culture Localization: Support for different languages and regions
  • Professional Formatting: Automatic application of professional TOC styling
  • Page Number Integration: Automatic page number calculation and updates

Parameters

Complete list of parameters for the Update Table of Contents action. Configure these parameters to control TOC generation and formatting.

Important: Parameters marked with an asterisk (***) are required. Advanced parameters provide fine-grained control over TOC formatting and appearance.

ParameterTypeDescriptionExample
File Content***Base64Source Word File Content
• Map Word file from previous action output
• Supports Word files from SharePoint, Dropbox, OneDrive, email attachments
• Can be dynamically retrieved from flow variables
• All type of file content can get from the Dropbox Get File actions
• Direct base64 can be given in the file content also
• Must be valid Word document (.docx, .doc formats)
• TOC is generated from this document's headings
[File Content from Get File]
File Name***StringWord Document Name
• Specify Word file name with extension (.docx, .doc)
• Used for processing and output file naming
• Must include proper file extension
• Supports dynamic naming from flow variables
• Output filename matches input filename
document.docx
Heading LevelsStringHeading Levels to Include in TOC
• Range format: "1-3" (includes heading levels 1, 2, and 3)
• Single level: "1" (includes only heading level 1)
• Multiple ranges: "1-2,4-6" (includes levels 1-2 and 4-6)
• Default: "1-3"
• Controls which heading levels appear in the TOC
• Maps to Word's built-in heading styles
• Scans document for existing TOC fields (FieldType.FieldTOC)
• Creates new TOC at document start if none exists
"1-3"
Use HyperlinksBooleanInclude Hyperlinks in Table of Contents
Yes - TOC entries are clickable links to headings
No - TOC entries are plain text
• Default: Yes
• Enables navigation by clicking TOC entries
• Works automatically in Word when enabled
• Generates TOC field option \h when enabled
• Updates fields multiple times for accuracy
Yes
Hide Tab LeaderBooleanHide Tab Leader Dots
Yes - No dots between text and page numbers
No - Dots between text and page numbers
• Default: Yes
• Tab leaders provide visual connection between text and page numbers
• Affects TOC visual appearance
• Generates TOC field option \z when enabled
• Calls UpdateFields() and UpdatePageLayout() in sequence
Yes
Use UppercaseBooleanUse Uppercase for TOC Entries
Yes - TOC entries displayed in uppercase
No - TOC entries in original case
• Default: Yes
• Affects the display format of TOC entries
• Applied to all TOC entries
• Generates TOC field option \u when enabled
• Adds "Table of Contents" title with Heading1 style
Yes
Culture NameStringDocument Culture/Locale
• Culture code for document processing (e.g., "en-US", "de-DE", "fr-FR")
• Default: null (no culture-specific processing)
• Affects document language and formatting
• Use valid culture codes for international documents
• Used for metadata and localization handling
en-US

Output

The PDF4me Update Table of Contents action returns comprehensive output data for seamless Power Automate flow integration:

Table View

Response data in a structured table format:

ParameterTypeDescription
documentBase64Word document with updated table of contents
SuccessBooleantrue if operation successful, false if failed
Error MessageStringError description (null if successful)
ErrorsArrayList of detailed error information (empty array if successful)

Common Error Messages

Understanding and troubleshooting errors helps ensure smooth table of contents update workflows:

Error MessageCauseSolution
"Request is empty"Request object is nullProvide valid request object
"Document is empty"Document object is nullProvide valid Word document
"Error updating table of contents"General exception during TOC updateCheck document format and parameters. Review exception details in Errors array
"Error loading document from bytes"Invalid or corrupted Word documentVerify the input document is a valid Word file (.docx)
"Error converting document to bytes"Error during document conversionCheck document integrity and format
"No headings found in document"Document does not contain heading stylesEnsure document has proper heading styles (Heading 1, Heading 2, etc.)
"Invalid heading levels specified"HeadingLevels parameter contains invalid formatUse valid format like "1-3", "1", or "1-2,4-6"
"Invalid culture name provided"Invalid CultureName formatUse valid culture format (e.g., en-US, fr-FR)

Workflow Examples

The PDF4me Update Table of Contents action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:

Scenario: Automatically generate and update Table of Contents for all technical manuals.

Configuration:

  • Heading Levels: "1-4"
  • Use Hyperlinks: Yes
  • Hide Tab Leader: No
  • Use Uppercase: No

Business Value:

  • Time Savings: 30 minutes per manual (automated vs manual TOC creation)
  • Consistency: 100% accurate TOC with proper page references
  • Professional Quality: Enhanced document navigation and usability

Workflow:

  1. Trigger: Technical manual uploaded to SharePoint
  2. Update Table of Contents: Generate comprehensive TOC
  3. Quality Check: Verify TOC accuracy
  4. Distribution: Send indexed manual to users

Industry Use Cases & Applications

Legal Industry Use Cases

  • Contract Navigation: Create detailed TOC for complex contracts
  • Legal Briefs: Generate navigable structure for court documents
  • Compliance Manuals: Index regulatory requirements and procedures
  • Case Documentation: Organize evidence and legal arguments

Get Help