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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Impossible to generate...
Power Automate
Suggested Answer

Impossible to generate pdf

(1) ShareShare
ReportReport
Posted on by 2
Hi everyone,
I've been struggling for weeks with a Power Automate flow that should generate PDF certificates from a Word template, and I can't get the Word-to-PDF conversion to work. I'm hoping someone here has solved this.
**My flow structure:**
1. Manual trigger
2. SharePoint – Create folder
3. Excel Online – List rows present in a table
4. Apply to each (looping over Excel rows)
   - Word Online Business – Populate a Microsoft Word template
   - SharePoint – Create file (.docx temp file, stored in SharePoint Documents library)
   - SharePoint – Get file content
   - Word Online Business – Convert Word Document to PDF ← FAILS HERE
   - SharePoint – Create file (.pdf final)
**The problem:**
The "Convert Word Document to PDF" action always fails with either:
- `BadRequest: The provided workflow action input is not valid`
- `NotFound: 404`
**What I've tried:**
- Using `body/Id` from the SharePoint Create file step → 404, the `file` parameter receives a double-encoded URL path like `%252fShared%252bDocuments%252f...` instead of a proper ID
- Using `body/ItemId` → BadRequest
- Adding a Delay step before conversion → still fails
- Using OneDrive for Business – Convert file instead → incompatible IDs when mixing with SharePoint connector
- Using "Create a Microsoft Word document" (in-memory) before conversion → the Convert action doesn't accept binary content in the File field
**Key observation:**
The "Convert Word Document to PDF" action (Word Online Business, operationId: GetFilePDF) seems to expect a specific file ID format that is incompatible with the IDs returned by the SharePoint connector. The `file` parameter keeps receiving an encoded path instead of a valid Graph/Drive ID.
**Environment:**
- SharePoint site: SharePoint Online (Microsoft 365)
- All connectors authenticated with the same user account
- The .docx temp file IS successfully created in SharePoint (Create file step returns green)
**Question:**
How can I correctly pass the SharePoint file ID to the "Convert Word Document to PDF" action so it finds the file? Is there a specific expression or connector combination that works reliably for this scenario?
Thank you in advance!
Categories:
I have the same question (0)
  • Suggested answer
    Sunil Kumar Pashikanti Profile Picture
    2,095 Moderator on at
     
    The Word → PDF conversion fails because the Word Online (Business) “Convert Word Document to PDF” action does NOT accept SharePoint’s File ID or Item ID. It only accepts a Graph DriveItem ID, but SharePoint’s Create file outputs a path‑based ID, which the action rejects (shows encoded %252f… paths).
     
    Suggestion:
    Instead of using SharePoint → Get file content → Word → Convert, do this:
    Create the .docx in OneDrive for Business (NOT SharePoint).
    Then use OneDrive for Business – Convert file (this connector accepts the ID directly).
    Optionally move the final PDF back to SharePoint.
     
    Why it works
    OneDrive and the Word connector use the same DriveItem ID format, so the ID is valid and conversion succeeds. SharePoint’s connector returns a different format that Word cannot interpret.
     
    Unfortunately, the Word Online (Business) PDF converter does not accept SharePoint file IDs because it requires a Graph DriveItem ID format, and SharePoint returns incompatible path‑encoded IDs — which is why you keep getting 404/BadRequest. (Confirmed across community posts and Microsoft responses.)
     
    But you can still use SharePoint by using one of these alternatives:
    Option A: Use OneDrive only for the conversion step
    Populate Word template → Save .docx in SharePoint
    Immediately Copy file to OneDrive
    Run “Convert file” (OneDrive for Business)
    Save PDF back to SharePoint
    This works because the OneDrive connector provides a valid Graph file ID that the converter understands.

    Option B: Use the SharePoint REST API + Power Automate HTTP action
    Use _api/v2.0/drive/items/{id}/content?format=pdf to convert the file.
    This works with SharePoint-hosted files but requires:
    Premium connector (HTTP)
    Correct DriveItem ID resolution
     
    Option C: Use OneDrive “Create file (In cloud)” + “Convert file”
    Instead of creating the Word doc in SharePoint first, create it in OneDrive, convert to PDF, then upload both final files to SharePoint.
     
    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.

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 Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 953

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 622

Last 30 days Overall leaderboard