Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

How to combine multiple lines into one sentence

(0) ShareShare
ReportReport
Posted on by

Hi community,

 

I'm trying to automate my business' collection of service requests to one excel spreadsheet. I've run into a road block trying to combine multiple lines into one sentence (See example). The request from our customers can sometimes be longer than one sentence as well. I'm only able to pull the first line, leaving the rest of the viable information still in the email.

 

Thanks for the help,

 

Marcus

  • Cayshin Profile Picture
    314 on at
    Re: How to combine multiple lines into one sentence

    In your third picture, you have the expression contact(outputs('Split_body_text')[82],'')) . That [82] is denoting to retrieve the 81st item (not 82nd, PA arrays start at 0) within the Split array. Since you are only indicating a single item and concat works by joining each item with whatever delimiter you set, you end up with...just that single item still.

     

    Since the trick will be determining when the text of the request actually ends, what I would suggest doing is identifying other unchanging delimiter points both above and below the text body you want to retrieve. You can then perform a series of splits: One to grab all the text after the top delimiter, then a second split to grab all the text above the second delimiter.

     

    For example, using your first picture, let's say our top delimiter is ">" and our bottom delimiter is "Details".

    We can start building an expression that looks like: Split(Last(Split(EMAILBODY, '>')), 'Details')[0]
    The green split will give us three sections, as noted by the pic below; the blue Last gets the last item (section) within the green split, which in this case is all the text from "Drains" onward; the pink Split is then splitting the blue section at the word "Details" and taking the first item of that array (so everything in before "Details").

    Cayshin_2-1680291056925.png

     

    You can then apply further Splits at linebreaks/New Lines to eliminate header/subject lines, and finally wrap it in a Concat(seriesOfSplitExpressions, ' ') to merge the request text body back together.

  • Nived_Nambiar Profile Picture
    17,739 Super User 2025 Season 1 on at
    Re: How to combine multiple lines into one sentence

    Hi @ServiceatMadden 

     

    Give a try with this expression 

     

    sp

    join(split(outputs('Split_body_text'),decodeUriComponent('%0A')),' ')

     

    This would help you

    Mark it as solution if it resolves your query !

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492