Im trying to build a flow to convert a sheet in an excel file into a PDF s that a second flow can email it out as an attachment but im failing at the first hurdle. my flow to convert to PDF wont run.
Id already added a step to copy the file from sharepoint to one drive as i couldnt find a convert tool to do it direct from sharepoint.
My flow looks like this..
error message ...
any ideas??
Hi @FayHudson
xlsx to pdf is supported but based on my testing, I was able to recreate the error by running the conversion on an invalid xlsx file. You mention that the file is copied from another location, have you manually tried opening the xlsx file on OneDrive? My guess is that the create file action in your other flow isn't creating a valid xlsx as expected and you need to sort the original flow out for this flow to work 😉
Please consider accepting my answer as a solution if it helps to solve your problem.
Cheers
Damien
Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks
Thanks Damien, however the previous flow to create the xls file in one drive appears to be working so im not sure what is going wrong?
The previous flow is as follows:
This flow successfully runs and i can see the xls file now in my one drive
Any ideas?
Hi @FayHudson
Can you open the file on OneDrive? How basic or complicated are the contents of the file?
Damien
Hi @DamoBird365
Now that you mention it, it is a spreadsheet with a number of sheets that contain tables feeding into a query. Is that a problem?
Ultimately im only copying to one drive because i cant find a convert to PDF straight from sharepoint (unless im missing something else that could help?!)
I have a file in excel and each week i want to issue a PDF of one of the sheets out to a dist list
@FayHudson maybe?! Joys of testing and troubleshooting these things. I’ve just read over the docs https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_get_content_format?view=o... and whilst there are known limitations, i can’t see anything about complex or multiple sheet workbooks. Can you try the routine on a simplified version of the workbook? Remove all but one sheet?
Using office scripts, it is possible to remove additional sheets but we need to discover if that’s the cause first.
Damien
it works with a simple excel file so is clearly an issue with the excel file itself!!
Thanks - but now still at a loss as to how i resolve
Can you try it on the sheet that you want to save as pdf? If that works, I can give you a solution for stripping out the other sheets on your copy file.
Damien
Sorry @DamoBird365 Im not sure I understand what you mean, as in save a copy of the file i want to convert but with all the other sheets stripped out and then see if the conversion works?
Thanks
Fay
I have now got the flow to succeed and create the PDF - however the flow seems to run twice and the first time it succeeds and then creates a failed run as well? Not sure if this is important?
The convert to PDF flow is as follows:
Im guessing now once ive copied the original file to one drive i need to understand how to delete the other worksheets to enable the PDF creation to occur. Is it best to do that or simply only copy the relevant worksheet?
Hi @FayHudson
One possible way to do this is to use the 2nd of two office scripts in this video https://youtu.be/4ZiMjjV1c3Q which allows you to delete sheets from an existing file.
Please consider accepting my answer as a solution if it helps to solve your problem.
Cheers
Damien
Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
64 | |
27 | |
22 | |
15 | |
15 |
User | Count |
---|---|
123 | |
46 | |
43 | |
35 | |
31 |