Showing results for 
Search instead for 
Did you mean: 
New Member

Trying to convert files to PDF

I have a pretty simple flow that needs to find xls files in a folder then convert them to PDF (by printing only page 1 in portrait format). I'm starting though with just trying to convert files and save them in the same folder and am having problems. After much trial and error I arrived at the following:

1. Recurrence (I can't find any better way to trigger this because I don't want to have to add a file to a folder just to do so)

Find Files in Folder: Pattern .xls, and selected the folder where they reside.

So far it works, it finds the four .xls files in that folder.

2. So the next step I have is Apply to Each

For "select output" I have no choice but "Body"

then "convert file" file="id" target type = "pdf." I tried other things like "file name" for convert file, but all of those fail. "ID" was the only one I got to work.


The flow says it runs successfully but I'm not seeing the converted PDF files. I tried "Convert by file path" but it won't let me just enter the path to the .xls files, it insists on my selecting a particular file!


I just picked up Power Automate last week so I'm brand new to this. Can anyone point me in the right direction?

1. Find files *.xls in a particular folder

2. Print Page 1 only as PDF.


Also is there any way to get the flow to run manually or is it better to just do it as files are copied in to that folder? The problem is that there will be multiple folders these .xls files are saved in.



Community Champion
Community Champion

Hi @tomservo75 

After the 'Convert File' action has run you need to add a 'Create File' action to add the converted PDF file to the desired location, for example:


The OneDrive connector will not allow you to convert a single page... you'll need to use a third party connector. An example of how to get just the first page of a PDF using the Encodian connector is detailed below:



A few notes on the expressioms used:


  • Split PDF
    • Split Configuration: you could simply use [1-1] which would return only the first page a single document in the returned array. The current [1-1], [2-999] will return two documents in the returned array... the first containing the first page and second PDF all pages from 2 to 999 or whatever is the last page.
  • Create File
    • File Name: first(body('Split_PDF')['documents'])['fileName'] - This expression gets the filename property of the first document returned in the array of documents returned by the 'Split PDF' action.
    • File Content: base64ToBinary(first(body('Split_PDF')['documents'])['fileContent']) - This expression gets the file content property of the first document returned in the array of documents returned by the 'Split PDF' action and provides in the correct format to the 'Create File' action




If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up.

Helpful resources

October Events

Mark Your Calendars

So many events happening this month - don't miss out!



Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,358)