Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Convert Multiple Documents to PDF?

Like (0) ShareShare
ReportReport
Posted on 18 Sep 2023 15:10:11 by 45

I have a scheduled flow that runs once a week and creates Word documents from a template. I have the premium Word connector so I can convert each of the Word documents to PDF. I want to loop through the library and convert multiple documents to PDF. Is this something I can do with the Word action? It looks like it's forcing me to choose a specific file and convert that file. I have tried populating variables with the file path and file name and adding those into the action, but it errors out.

 

Is it possible to use Apply to Each and loop through the Word documents to convert each of them to PDF? Or do I have to use a Switch and do them all separately?

 

If I have to use a Switch and do them all separately, how can I build the flow dynamically so it can count the number of documents in the library and convert them? The number will change weekly.

 

We would prefer not to use OneDrive, but if that's the only way to make this work, so be it. Any suggestions are welcome.

  • Verified answer
    v-mengmli-msft Profile Picture
    on 19 Sep 2023 at 06:24:40
    Re: Convert Multiple Documents to PDF?

    Hi @This-n-That ,

     

    Are you using the following Action to convert word to PDF? The problem you are currently encountering is that you don't want to use this action, you want to create a flow that runs on time, which can automatically convert word to PDF.

    vmengmlimsft_0-1695104112930.png

    Whether to use OneDrive depends on where your files are saved. If you can use the action in OneDrive to get the file, then I suggest you use the action in OneDrive to convert the file to PDF.

    The following is the main content of my test:

    1)Get all files in a folder.

    vmengmlimsft_1-1695104413107.png

    2)Operate on each file. I use a condition to determine if the file in the folder is already in PDF format.

    vmengmlimsft_2-1695104502785.png

     

    Hope this helps you!

    -------------------------------------------------------------------------------------------------------------------------------

    If my answer solves your problem, please accept it as a solution to help more people stuck on the same problem find it.

     

    Best regards,

    Rimmon Li

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started