web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Copying text from Word...
Power Automate
Answered

Copying text from Word .docx to Email

(0) ShareShare
ReportReport
Posted on by 112

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!

 

 

Categories:
I have the same question (0)
  • Jay-Encodian Profile Picture
    2,920 on at

    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 Profile Picture
    8,402 Most Valuable Professional on at

    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.

  • SimonSmith84 Profile Picture
    112 on at

     

    @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. 

  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    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.

     

  • SimonSmith84 Profile Picture
    112 on at

    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. 

  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at

    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.

  • Verified answer
    Jay-Encodian Profile Picture
    2,920 on at

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

  • SimonSmith84 Profile Picture
    112 on at

    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. 

  • takolota1 Profile Picture
    4,974 Moderator on at

    You could also use the OneDrive action to convert a given word document to a pdf, then use parts of this template to either extract exact data values from the document or just get the entire file contents as a text replica:

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/Extract-Data-From-PDFs-and-Images-With-GPT/td-p/2201345

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard