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

Community site session details

Session Id : FL6ULJtOHQoiqz1mrUstyQ
Power Automate - Building Flows
Answered

Inserting regular text content from a txt file into word template, creates extra line breaks

Like (0) ShareShare
ReportReport
Posted on 13 Dec 2023 09:58:59 by 11

I'm using regular  content control for text in word template and have tried to create and set new styles and paragraphs in the word template without any success. Is there somehow possible  to insert the text without getting the extra line breaks? Any help is greatly appreciated.

 

The regular txt file

Tinkominko_1-1702460799216.png

 

The output after reading the content from Sharepoint file:

Tinkominko_3-1702461153866.png

 

After the flow has created the word file

Tinkominko_0-1702460632994.png

Tinkominko_2-1702460945598.png

Best regards

Tinkominko

 

  • Verified answer
    Tinkominko Profile Picture
    11 on 13 Dec 2023 at 14:56:23
    Re: Inserting regular text content from a txt file into word template, creates extra line breaks

    Hi @grantjenkins ,

     

    Thanks for your reply. Tested out your suggestion and it didn't had the desired outcome. The out come was the same as before, BUT you gave me the clue to test out your idea and by changing your suggestion with this code:

     

     

    replace(variables('ProductInfoContent'), decodeUriComponent('%0A'),'')

    The outcome:

     

    Tinkominko_1-1702479460539.png

     

    Thanks again and have a great day 🙂

     

    Best regards

    Tinkominko

  • Verified answer
    grantjenkins Profile Picture
    11,059 Moderator on 13 Dec 2023 at 10:14:22
    Re: Inserting regular text content from a txt file into word template, creates extra line breaks

    Can you try using the following expression to remove the additional new lines that you are getting.

     

    replace(variables('ProductInfoContent'), decodeUriComponent('%0A%0A'), decodeUriComponent('%0A'))

    grantjenkins_0-1702462437947.png

     

    You would use the output from the expression as input into your Word document.

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2