cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gm355
Level: Powered On

Convert txt file from email attachment to pdf

Hi,

 

I'm looking to create a Flow that will take a txt file that is an attachment in an email, convert it to pdf and then save on an FTP.

 

Does anyone know how to do this?

 

Thanks!

10 REPLIES 10
Super User
Super User

Re: Convert txt file from email attachment to pdf

Try the following

 

Assuming you have the content of your attachment already.

Try the following actions:

Create File (OneDrive for Business) to store the file in onedrive

Convert file (OneDrive for Business) to convert the previously stored file to PDF

 

then use a ftp action to upload the pdf as required.

 

There are other PDF converters but they are usually subscription based

Community Support Team
Community Support Team

Re: Convert txt file from email attachment to pdf

 

Hi @gm355 ,

 

As Gristy suggested, please refer to the following configuration, I use SharePoint to save the PDF file as an example:

36.PNG37.PNG

Hope it helps.

 

Best Regards,

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.
gm355
Level: Powered On

Re: Convert txt file from email attachment to pdf

Thanks. I've tried that, but I keep getting the following error.

 

Capture1.PNGCapture.PNG

Highlighted
Community Support Team
Community Support Team

Re: Convert txt file from email attachment to pdf

 

Hi @gm355 ,

 

Please try to change Convert file action to Convert file using path action.

39.PNG

 

Best Regards,

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.
gm355
Level: Powered On

Re: Convert txt file from email attachment to pdf

Hi @v-bacao-msft ,

 

Getting this error now:

 

Capture1.PNGCapture.PNG

rich8rd
Level: Powered On

Re: Convert txt file from email attachment to pdf

I'm getting the above error also for converting simple txt file

gm355
Level: Powered On

Re: Convert txt file from email attachment to pdf

Hi @rich8rd , I never found a solution for this unfortunately.

Super User
Super User

Re: Convert txt file from email attachment to pdf

Hey @gm355 @rich8rd @v-bacao-msft @Gristy 

I just ran a few tests on this as well... TXT file conversion fails via the OneDrive connector.

Same files convert fine via third party connectors such as the Encodian connector - Convert Text to PDF

See details below:

1.png

 

a.png

 

HTH

Jay

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

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

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

rich8rd
Level: Powered On

Re: Convert txt file from email attachment to pdf

Hi Guys, create a text file in .html format then convert to pdf is currently supported (while txt to pdf is not supported according microsoft premier supported). So the below is working for me. I think this presents a valid and easy workaround as creating a html is just a matter of wrapping your txt file with <html> and <body> tag with some <br> sprinkled around. 

 

Capture.PNG

gm355
Level: Powered On

Re: Convert txt file from email attachment to pdf

Thanks @rich8rd , can you show the full workflow please?

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Coming Soon: T-shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors
Users online (6,075)