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
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").
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.
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 !
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492