cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

Convert SharePoint Word Doc to PDF

Has anyone successfully created a PDF file from a Microsoft Word Document using Flow?

I am able to create a flow that passes the new 'flow checker' but the PDF file is not viewable. I receive the following message when trying to view the PDF file: 

Error
Failed to load PDF document.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @kelliprieto,

 

Could you share a screenshot of your Flow configuration?

I have made a test on my side and the flow works well. Please take a try with the following workaround:

Use Condition to determine the file type and see if its filename with extension ends with ".doc/.docx".

If yes, get the file content, convert the file format with OneDrive-Convert file action, and create a new file with Create file.

Finally, consider deleting the transition file created in OneDrive.

Image reference:

Expression:

or(endsWith(triggerBody()?['{FilenameWithExtension}'],'.doc'),endsWith(triggerBody()?['{FilenameWithExtension}'],'.docx'))

31.PNG

30.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Helper III
Helper III

I have been able to do it using One drive.  I used the below as a reference to set mine up and it works.

https://www.youtube.com/watch?v=vUoRAxFNxlA

Community Support
Community Support

Hi @kelliprieto,

 

Could you share a screenshot of your Flow configuration?

I have made a test on my side and the flow works well. Please take a try with the following workaround:

Use Condition to determine the file type and see if its filename with extension ends with ".doc/.docx".

If yes, get the file content, convert the file format with OneDrive-Convert file action, and create a new file with Create file.

Finally, consider deleting the transition file created in OneDrive.

Image reference:

Expression:

or(endsWith(triggerBody()?['{FilenameWithExtension}'],'.doc'),endsWith(triggerBody()?['{FilenameWithExtension}'],'.docx'))

31.PNG

30.PNG

Please take a try.

 

Best Regards,

Barry

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

That worked! Thank you!

I am trying to do something similar but my use case is a little different. In short, I would like to convert a submitted Form (O365 Forms) and send the results as a PDF document to either a SharePoint list or document folder. So far I have created a Flow that can do the following.

  • When a Form Response is received,
    • Compose content from responses
    • Create File in One Drive for Business with Compose Output as Word doc file
      • File name is dynamically created using fields from Form responses
    • Create File in SharePoint  with Compose Output as Word doc file

My Flow is successful to this point. 

 

At this point, I tried adding the steps in this solution beginning with Get File Content. It looks like I can use the Name parameter to get the created file name but I do not see how I can add the SharePoint folder path. When I hard code the filename, I get the step to work. Any suggestions?

When you select the "create file" action for SharePoint, you should be able to select the site then the folder path in a dropdown. If not, you can manually enter the folder path. 

 

It is also possible to send your form results to a SharePoint list by using the "create item" Sharepoint action. Before you create this flow, you'll need to create corresponding columns for the form results (questions) in the SharePoint list. These columns will be referenced in the "create item" step. 

Hi Barry,

 

This solution is no longer working. Did the Flow actions change? 

 

I can create PDFs but the PDF file content cannot be viewed.

 

Kelli

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (52,665)