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 / Merge multiline string...
Power Automate
Unanswered

Merge multiline string into single line

(0) ShareShare
ReportReport
Posted on by

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,073 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
    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
    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,073 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,073 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
    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

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard