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

Send mail with text from word document in body

Hi,

 

Is it also possible to use Flow,

if a new word online document appears in a folder an email is sent with the text of the word document in the body?

That must be done for every online word document that is stored in the folder.

 

flow17.png

7 REPLIES 7
Super User
Super User

Re: Send mail with text from word document in body

@frixel 

Hi there, welcome!

 

If you switch your Trigger to "When a file is created in a folder" (not the properties only one), you'll have an option for "File Content" in your dynamic content drop down (see below)...try that and let us know.

 

2019-05-03 14_45_08-Create your flow _ Microsoft Flow.png

Keep us posted.

-Ed-

frixel
Level: Powered On

Re: Send mail with text from word document in body

I have Then mismatch text in the body.(sorry i don’t no hoe ADD a photo on mobile app)
When i add file content in the body
Super User
Super User

Re: Send mail with text from word document in body

No worries, I tried it out on my own.  It looks like the "file content" is a binary file, which is why you can't just dump the text to the inside of an email.  I looked for something that would convert the .doc file so you could put the contents as text into the email, but didn't immediately see anything in Flow.

 

But, there are a couple of options - 

  • First, maybe look upstream.  How are the files getting to the Sharepoint library?  And can they be saved as a different format (html or text would work).
  • If not, then you could use the Word connector to convert the doc to a pdf, and then use another connector (Plumsail or Encodian both have one) to convert the pdf to text.  And then finally push the plain text to your email.

I don't think it will be pretty (html might be the best-looking thing) because of all of the formatting stuff Word and pdfs put in there.  But take a look at those options and let us know if either works in your scenario and we can try to build something together.  Others might have better ideas, but this is what I got 🙂

 

Keep us posted.

-Ed

 

Super User
Super User

Re: Send mail with text from word document in body

Ok, so I found out the Word connector forces you to choose a specific file, rather than dynamic content.

But...I took a look at Encodian, they have a free plan that limits you to 50 actions per month and some other limitations.  Details here.  In addition to the action to pull the text from a pdf, they had a doc > pdf action. 

 

So I was able to find a solution by converting the doc to a pdf, then stripping the text from the pdf, and throwing that in the email.  Here's what it looks like (you'll probably want to add a condition that verifies the source file is indeed a word doc):20190504a.PNG

 

Take a look at their connector (or the other one from Plumsail) and see if either will work for you.  The email I got wasn't pretty (no formatting in the text), but the content was definitely there.

Let us know how it turns out.

-Ed-

frixel
Level: Powered On

Re: Send mail with text from word document in body

Hi @edgonzales 

Yes, it is indeed better to save it as a .html in word.

The disadvantage is that folders with .html files are also stored.

How should I remove it after sending the email to prevent contamination?

Super User
Super User

Re: Send mail with text from word document in body

The Sharepoint connector has a "Move File", you can use that.  Or there is a File System connector with a Delete File action.  (I don't know much about that one, but I bet there's loads of documentation on it as I think it is a System Connector.

frixel
Level: Powered On

Re: Send mail with text from word document in body

Hi @edgonzales 

Hi I try to save the word document directly to sharepoint as a filtered webpage (then no folders are saved and is better) 

However, word indicates that it cannot be saved on sharepoint.

 

word1.png

Helpful resources

Announcements
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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,151)