cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Basic_User007
Kudo Kingpin
Kudo Kingpin

Convert Word Docx to PDF

Is there a way I can do this for a selected file? So each time a file is selected it will convert to PDF - the action looks like I need to select the exact file I want to convert when using SharePoint Online - if I do not know what file I want to convert or if this is variable can I incorporate that into the Flow? 

33 REPLIES 33
Basic_User007
Kudo Kingpin
Kudo Kingpin

 

Inkedconvert word to pdf_LI.jpg

 

Mine the trigger is when an item is Modifed and then it looks at a few condtions. Using the Populate to Word it creates the document, converts to pdf and then I take it a step further and attach that pdf document back to the item on my SharePoint list as an attachment so it can viewed in my App. Works GREAT!

 

See below: (let me know if you need further explanation on any of the steps and I will post more breakdown)

 

Capture.JPG

Mine the trigger is when an item is Modifed and then it looks at a few condtions. Using the Populate to Word it creates the document, converts to pdf and then I take it a step further and attach that pdf document back to the item on my SharePoint list as an attachment so it can viewed in my App. Works GREAT!

 

See below: (let me know if you need further explanation on any of the steps and I will post more breakdown)

 

Capture.JPG

is it possible to do the same withouth writing back to OneDrive? Seems like an unecessary step, if it can be avoided if you just want to use SharePoint? 

 

To explain further, these files will be uploaded into SharePoint then routed out to different people for approval. Then once approved I want to convert them to PDF so we know its the final approved document. 

It is only the convert to PDF that does it back to OneDrive..and on mine it is just put there for a minute and then deletes it. There are a few other options for converting a document to a pdf that are probably not as simple but if you really wanted to avoid that part you could do a work around for that.

Hi @Basic_User007 

 

Have a way to do this without OneDrive, using the action 'Convert Word Document to PDF' but the action need the word identifier, this identifier only can be found in SharePoint Thumbnail column, I use this function to get:

 

 

first(split(last(split(triggerBody()?['{Thumbnail}']?['Large'],'items%2f')),'%3fversion'))

Anotação 2019-04-10 092248.jpg

 

 

I think that save file in OneDrive, convert this and after delete is the best approuch for a while

 


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


Ok so I am having problems with the flow, it isnot able to reach the convert to pdf action as fails at get file content with error file not found. 

 

Copying image of flow steps I have created below along with error, any suggestions on how best to resolve this? 

 

convert word to pdf filenot found.png

 

convert word to pdf flow.png

 

Hi @Basic_User007 .

 

You are using the wrong column in File Identifier,

 

You are using ID, but you need to use IdentifierAnotação 2019-05-14 092117.jpg

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


I posted a blog with detailed notes on using this feature: 

 

https://powerusers.microsoft.com/t5/Microsoft-Flow-Community-Blog/Generating-PDF-in-Flow-using-Word-...

 

See if this helps any.

Identifier field does not exist for me to select

 

Inkedpdf id_LI.jpg

 

@Basic_User007 

 

You are doing something different than what I had notes on because your steps are pretty different. If you are using 'For a selected file' you shouldn't need the get file content or the get file metadata as separate steps because you can add those into the 'For a selected file' trigger. 



 

To get Identifier use this action 'Get File Properties', inside it has the Identifier

 

Anotação 2019-05-14 094645.jpg

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


@Basic_User007 

 

What exactly do you want to be your trigger and what do you want to happen? It looks like you want to be able to select a file as your trigger and then take that file and convert it to a pdf and then save it back to SP. Is that correct?

@gamoraeswhen I add get file properties there is not any dynamic content for me to select an id input - which is mandatory, unless you suggest me inputting some text? 

 

@rebeccasthat is exactly what I am trying to achieve - select file, to select flow which converts file to pdf and saves the pdf in a folder, doesnt sound too complicated but proving to be!! :S 

 

Inkedget file properties_LI.jpg

 

@Basic_User007 

 

Okay...so you need:

 

For a selected file

Get file properties, the Id is "Field" selected from the dynamic content of the 'For a selected file'

Get file content, the File Identifier is "Identifier" selected from the dynamic content of the 'Get file properties'

 

Then you can go on with your create file etc. Don't forget that when you change stuff up top you may need to remove and replace any of the dynamic content below...changes up top can lead to that need.

 

I did a quick test on my side so if you still have trouble let me know and I will send a few screen shots.

I don't why it's not appearing 😮

 

Paste this text inside field, and test please

 

@{triggerBody()?['entity']?['ID']}

 


Did I answer your question? Mark my post as a solution!

Gustavo Moraes, o astronauta brasileiro do Flow!


Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (1,068)