Skip to main content

Notifications

Community site session details

Community site session details

Session Id : hKVmOD/3QcWS7iMd5+E/N8
Power Automate - General Discussion
Answered

Merge multiline string into single line

Like (0) ShareShare
ReportReport
Posted on 18 Nov 2020 06:07:26 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

  • jamesoza Profile Picture
    3 on 24 Sep 2023 at 10:19:31
    Re: Merge multiline string into single line

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

  • Community Power Platform Member Profile Picture
    on 26 Nov 2020 at 05:34:20
    Re: Merge multiline string into single line

    Hi @VictorIvanidze ,

     

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

     

    Thanks for your help.

  • VictorIvanidze Profile Picture
    12,214 on 23 Nov 2020 at 13:34:26
    Re: Merge multiline string into single line

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

  • VictorIvanidze Profile Picture
    12,214 on 19 Nov 2020 at 08:44:30
    Re: Merge multiline string into single line

    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
     
  • Community Power Platform Member Profile Picture
    on 19 Nov 2020 at 02:41:51
    Re: Merge multiline string into single line

    Hi @VictorIvanidze ,

     

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

  • Community Power Platform Member Profile Picture
    on 19 Nov 2020 at 02:20:30
    Re: Merge multiline string into single line

    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.

     

  • Jay-Encodian Profile Picture
    2,920 on 18 Nov 2020 at 14:11:57
    Re: Merge multiline string into single line

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

  • VictorIvanidze Profile Picture
    12,214 on 18 Nov 2020 at 10:32:50
    Re: Merge multiline string into single line

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

  • Verified answer
    Jay-Encodian Profile Picture
    2,920 on 18 Nov 2020 at 09:01:04

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,765 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started