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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Merge multiline string...
Power Automate
Answered

Merge multiline string into single line

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi ,

I designed a flow, that grabs value stored in the "subject" field from the body of the email.

I used Html to Text option to convert email into text. While fetching the subject, it split into two lines. For my flow to work I need the value of subject in single line.

Below image is output of HTML to TEXT action output.

 

The highlighted text I want to capture into a single line.
Html to Text.PNG

Capture.PNG

 

The string function I used is 

substring(body('Html_to_text'),add(indexOf(body('Html_to_text'), 'Subject'),7),sub(indexOf(body('Html_to_text'), 'Please'),add(indexOf(body('Html_to_text'),'Subject'),7))).

 

Is there any way I can merge the multiline string into one?


Help much appreciated!

Thanks

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

    It seems much easier will be remove CR/LF from the string.

  • Jay-Encodian Profile Picture
    2,920 on at

    @VictorIvanidze refer to the posts, this is covered... the typical approaches for removing an LB don't work

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Jay-Encodian ,

     

    Thanks for your reply.

     

    I tried working with URI component. However, when I compare the value of the subject with text field, my conditions are getting failed.

     

    My subject got 

    uriComponentToString(replace(uriComponent(variables('SubjectLine')),'%0A',' ')).
     
    It is showing me string output. But my comparison conditions are failing.

     

    SPatnala_0-1605752333079.png

     

    Help much appreciated!

     

    Thank you.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @VictorIvanidze ,

     

    Thanks for your reply. May I know which expression to use for removing CR/LF from the string in MS flow?

  • VictorIvanidze Profile Picture
    13,079 on at

    Hi @Anonymous,

     

    syntax is: replace(text: string, oldText: string, newText: string) 

     

    So you have try to use something like

    replace(variables('Subject'),variables('CRLF'),'')
     
    Have a look at this flow:
    crlf1.png
     
  • VictorIvanidze Profile Picture
    13,079 on at

    Hi @Anonymous, thanks for your cudo but please tell me if it's really working for you? 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @VictorIvanidze ,

     

    I haven't tried this solution. it worked for me with uricomponent solution.

     

    Thanks for your help.

  • jamesoza Profile Picture
    3 on at

    Sometimes I use online tools such as MultiLine to Single Line which help to test and expected results we can get.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard