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 / Compose output missing...
Power Automate
Answered

Compose output missing new lines

(0) ShareShare
ReportReport
Posted on by 435

Hello again,

 

I am working on a flow that emails a few fields from a SP list item as a text file. The problem is, when the text file arrives, it's missing the new lines. Is there something I can do, to have the line returns carry over to the attachments?

 

 

1.jpg

2.jpg

 

Categories:
I have the same question (0)
  • AlanPs1 Profile Picture
    2,471 on at

    Hi @FoDelement 

    When you say "it's missing the new lines.", are you referring to the spaces you have created below, the carriage returns?:Capture-382.png

    Are you looking for your output to be:

     

    "William

     

    Sharpe" ?

     

    If so, set email to HTML and use <br> (or multiple <br><br>) for a line break or carriage return (in your Compose) is one easy way and the way I favour.

     

    If you have found my post helpful, please mark thumbs up.

    Any other questions, just ask.

    Thanks, Alan

  • FoDelement Profile Picture
    435 on at
    Hello, and thank you for your reply.

    It is going to the email as an attachment. (In this case a .txt) so it does not support HTML.

    I did however try and do a "convert from HTML" and use that output for the attachment, to the same results.
  • AlanPs1 Profile Picture
    2,471 on at

    Hi @FoDelement 

    Sorry, I missed that. I though maybe the txt file was for demo purposes.

    Either way, I have recreated your Flow and have tested with values from a list and raw text in a compose as you have.Capture-384.png

    Both my text files have output with the carriage returns present:Capture-388.pngCapture-385.png

    and from the list data:Capture-387.png

    Capture-386.png

    Thanks, Alan

  • FoDelement Profile Picture
    435 on at

    I just tried it again and got the same results. (Different PC, just to see if it was a notepad issue) 

     

    Is this how you have the email set up?

     

     

    Capture.PNG

    EDIT: I decided to test it a different way, this time creating a onedrive file, and I get the same result.

     

    2019-03-19 08_43_16-Run History _ Microsoft Flow.jpg

     

    So I decided to open the file with notepad++ and it has the returns!

    The issue seems to be with notepad, but I tried two different machines. The only common variable I can think of, is that they are both windows 10. I will test it on a windows 7 machine and see what happens.

  • AlanPs1 Profile Picture
    2,471 on at

    Hi @FoDelement 

    I used Windows 10 in my testing last night.

    Yeah, looks like notepad in some way.

     

    My email is set up the same way although I have put text in the body as it is a mandatory field. But that is all.

     

    This posts - https://superuser.com/questions/362087/notepad-ignoring-linebreaks , seems to have additional information on the issue, you may have seen this already.

     

    Glad to clarify it is not a Flow issue and the Flow works well as do you!

     

    Thanks, Alan

  • FoDelement Profile Picture
    435 on at

     

    Glad to clarify it is not a Flow issue and the Flow works well as do you!

     

     


    Same result on the windows 7 machine.  For your carriage returns, you were not using anything fancy outside of pressing the enter key by chance, were you?

     

    {
     "inputs": "Why\nWont\nThis\nWork"
    }

    This is my input for the "Compose" action. (Using the peekcode function)

  • Verified answer
    FoDelement Profile Picture
    435 on at

    Okay, I fixed it!

     

    The peek code is what helped me solve it. I noticed, it was sending returns as \n where as notepad requires them to be \r\n

    So this expression is what fixed it for me.

     

    json('{"NL":"\r\n"}')?['NL']
    Thank you for your help!
     
    2019-03-19 09_52_39-Start.jpg
     
     
  • Ics_rthompsoneu Profile Picture
    25 on at
    What is "NL".

    Would you please show what is under the compose

    json('{"NL":"\r\n"}')?['NL']
  • Vlad1 Profile Picture
    16 on at

    Amazing, thank you so much!! I spent couple hours of struggling to find the solution 🙂

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