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

Copying text from Word .docx to Email

Hi all, 

 

I've kind of hit a brick wall and I'm hoping someone can help. 

 

Scenario: We send our customers an e-mail requesting some network information prior to installation, requesting they fill in some basic information. The content of the email/attachment varies depending on the model they are having. 

 

The attachment part i've resolved fairly easily. The sharepoint list that contains the customer info has a calculted field called "attachment link" that dynamically creates the filepath for them to use. 

 

I figured I'd use the same approach to the content of the email, but can't get it to work. 

I have a file for each model with the template for the content held within it. Initially I tried inputting the dynamic content 'File Content' directly into the email, but that isn't given as an option, so I figured I'd run it through the 'Compose' action first to give me an output to work with. 

SimonSmith84_0-1653049581278.png

 

This has worked, but the email generated looks like this: 

SimonSmith84_1-1653049413073.png

 

I'm assuming it's taking all of the XML included in the file content, but I can't see or find an easy way to remove this, and retain the text and (preferably, but not essentially) the formatting as well. 

 

Any hints in the right direction would be gratefully received!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

@SimonSmith84 @CFernandes - The Encodian action also covers this... just change the output of the 'Convert Word' action from 'TXT' to 'HTML'

View solution in original post

8 REPLIES 8
Jay-Encodian
Community Champion
Community Champion

Hey @SimonSmith84 

You can extract the text from a Word document by converting the document to TXT format using the Encodian connectors 'Convert Word' action, example flow can be found here: https://www.encodian.com/blog/search-word-documents-with-microsoft-power-automate/

HTH

Jay

CFernandes
Super User
Super User

Hey @SimonSmith84 

 

Its not that easy 🙂 as Power Automate returns the entire document with encoding\formatting.

 

You need to try something this - https://www.tachytelic.net/2021/05/power-automate-extract-text-from-word-docx-file/ 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

 

@CFernandes :

Yeah I read that article. My difficulty is the method he uses doesn' work for my particular setup, as my 'Get File Content Path' doesn't offer its output as dynamic content for filtering an array. It is as close as I've come to an answer though. 

 

@Jay-Encodian - Hi Jay, thanks for this. I was hoping for a solution that allowed me to retain the formatting etc. If it comes to it, I can replace the .docx file with a .txt file anyway and then apply formatting in HTML I guess. I just wanted to try and do it with the word doc first to see if I could retain the formatting. This would allow other users to update the documentation and have the formatting carry over. 

Hey @SimonSmith84 

 

Workaround with third party Connector.

 

CFernandes_0-1653052056027.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

 

Hey @CFernandes - That looks perfect! Please can you provide the name of the connector? Can't see it when eyeballing steps etc. even with "convert document" in the search field. 

Hello @SimonSmith84 

 

I am using the Muhimbi connector -

 

CFernandes_0-1653052761996.png

 

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

 

P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

@SimonSmith84 @CFernandes - The Encodian action also covers this... just change the output of the 'Convert Word' action from 'TXT' to 'HTML'

SimonSmith84
Helper II
Helper II

Thanks both. I managed to find a workaround by saving my word documents as HTML files in the first instance. (They were being used as email templates). 

 

I've checked out Muhimbi, which looks great, but would never be able to justify the costs of it to the higher ups! I'll take a look at encodian in the near future too. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (3,761)