web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Add line break within ...
Power Automate
Answered

Add line break within an "if" expression

(0) ShareShare
ReportReport
Posted on by 209

Hello,

 

I've exhausted my researching skills. Is it possible to add a line break within an "if" expression in SharePoint flow (I'm using expressions in an email body)? I have a list of 5 IF statements, however, if more than one is TRUE, it prints what I want, but all jumbled next to each other. And If I add "<br>" in the email body in between each expression and the first expression is true, then the next is false, and the third is true, it's a double page break that I don't want. First screenshot is what I DO NOT want, the second screenshot is the desired result: 

 

 

2019-01-18_12-43-05.jpg

22019-01-18_13-00-12.jpg

Categories:
I have the same question (0)
  • Verified answer
    v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi @Morghan,

     

    You mentioned that you have “a list of 5 IF statements”, so I have made the following test which will return items with line breaks.

    When an item is created in SharePoint list, send an email. In the email body, input the following if functions and make sure enable Yes for the Is HTML field.

     

    if(equals(triggerBody()?['OData__x0077_ib1'],'test1'),'test1<br/>','')
    
    if(equals(triggerBody()?['nyrl'],'test2'),'test2<br/>','')
    
    if(equals(triggerBody()?['OData__x0066_mb4'],'test3'),'test3<br/>','')

     

    1.PNG

    Then I triggered the flow and all the items will be displayed likes below:

     2.PNG

    Hope this could be a reference. If you need more help, please share more details on your flow.

     

    Best regards,

    Mabel

     

  • Morghan Profile Picture
    209 on at

    Aw, man! I was so close. Yes, the "<br/>" did the trick. Thank you very much @v-yamao-msft!

  • DJSky Profile Picture
    3 on at

    Great solution Mabel! I have an extension of the original question - I would like to add a line break as well, but your solution only seems to work if the whole "value if true" portion is custom text. My "value if true" portion of the formula refers to another field. How do I add the <br/> to the end of that?

     

    Current formula: if(equals(items('Apply_to_each')?['Category']?['Value'], 'Create new GID'),items('Apply_to_each')?['Title'],'')

     

    Where I want to add <br/> : Current formula: if(equals(items('Apply_to_each')?['Category']?['Value'], 'Create new GID'),items('Apply_to_each')?['Title']<br/>,'')

     

    I tried this and it didn't work: if(equals(items('Apply_to_each')?['Category']?['Value'], 'Create new GID'),items('Apply_to_each')?['Title']'<br/>','')

     

    Best,

     

    Dennis

  • EmilyC Profile Picture
    3 on at

    I realize a lot of time has passed, but I ran into the same issue and used concat(field,'<br/>') instead of just the field value.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 238 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 225

#3
Haque Profile Picture

Haque 181

Last 30 days Overall leaderboard