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 / I have 3 strings of te...
Power Automate
Unanswered

I have 3 strings of text, and I need them to appear as 3 separate lines of text in an e-mail

(0) ShareShare
ReportReport
Posted on by 19

I split 3 separate strings in my flow, but when it put the string in an e-mail, it puts everything on one line.  I understand that HTML doesn't understand special characters like carriage returns, but I was wondering if I could somehow use Power Automate to extract each line of text, store each string in 3 separate string variables and then put the output of each variable in an e-mail.

 

Send an e-mail v2:

String variable 1

String variable 2

string variable 3

  

I've attached 3 screenshots.  One has the split output, the 2nd shows the code, the other shows what is currently being displayed when I populate the string to an e-mail.  

 

My goal is to have the e-mail display the comments in the following way:

 

I'm adding a comment.

Now I'm adding a second comment.

Now I'm adding a 3rd comment

 

Thank you for your help!

Categories:
I have the same question (0)
  • Verified answer
    AWorley Profile Picture
    414 Super User 2024 Season 1 on at

    The output of that split is in the format of an array. So just do the following: 

    1. apply to each
    2. Use a string variable and append to string variable action to store the new data with the Concat() expression to add a <br> tag for each value.
    3. Compile the value into a Compose action, 
    4. format your email in a rich HTML text, passing your compose action value into the email itself.

    This would automatically format the email to have a <br> tag (line break in HTML

    AWorley_0-1698331576826.png

     

     

    Here is an article on looping through an array value. 

    https://www.powertechtips.com/loop-through-array-power-automate/

    converting to a string will remove the [""] characters, the concat compose action will apply the line break HTML values. Then you just pass the String variable into your HTML email and it should render as line breaks even if the value would look like this:

    String variable 1<br>String variable 2<br>string variable 3

  • crosbywr Profile Picture
    19 on at

    Thank you so much for your post AWorley!  What you posted makes sense. 

    So the expression concat should use the following syntax:  concat(outputs('Apply to Each')('Array'))   

    Let me know if I have that wrong. 

     

    I'm going to test this out in my flow.  Hopefully I'll have a response later today.  

  • AWorley Profile Picture
    414 Super User 2024 Season 1 on at

    I believe it would just be the current Item method in the quick select pane. So something like

    concat(items('Apply_to_each'),'<br>')
  • crosbywr Profile Picture
    19 on at

    That's the correct syntax.  I was overcomplicating things per usual.   Thank you so much for your help!

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard