cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hannah_Hod
New Member

Email removing line breaks

Hi,

 

I have a form that updates a Sharepoint list. I need to send a notification email from the list, but it is stripping out the line breaks. 

Screenshot 2020-12-14 at 20.38.22.png

Screenshot 2020-12-14 at 20.49.55.png

Here is now the data shows in Sharepoint with line breaks 

Screenshot 2020-12-14 at 20.54.23.png

 

And the email that is generated with no line breaks

 

Screenshot 2020-12-14 at 20.52.29.png

 

 

The HTML from the email is as below. I'm very new to Power Automate and don't know how to write in HTML (someone made the below for me) but I have tried to remove any sensitive data which might mean the HTML isn't very pretty

 

 

 

<html> 
<style>
  h1 {font-family:verdana;color:red;}
  h2 {font-family:verdana;}
  p {font-family:verdana;color:black;}
</style>
<head>	
<div align=center>
<table style='width:500.0pt;'>
<tr>
<td valign=top style='padding:0cm 0cm 0cm 0cm'>
<table border=0 cellspacing=0 cellpadding=0 width=0 style='width:500.0pt;'>
<tr>
<td width=400 valign=top style='width:300.0pt;background:#444444; padding:3.75pt 3.75pt 3.75pt 7.5pt'>
<p style='line-height:12.0pt'>
<span style='font-size:7.5pt; font-family:"Verdana",sans-serif;color:white;'>INTERNAL EMAIL ONLY - DO NOT CIRCULATE EXTERNALLY </span></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</head>

<body style="background-color:LightGray;">
<p align=center style='text-align:center'>&nbsp;</p>


<p>&nbsp</p>
<div align=center>
<!-- START OF OVERVIEW SECTION -->
<table border=0 cellspacing=0 cellpadding=0 width=0  style='width:500.0pt;mso-padding-alt: 0cm 0cm 0cm 0cm'>
<tr>
<td valign=top style='background:white;padding:18.0pt 18.0pt 18.0pt 18.0pt;'>
<p align=center style='text-align:center;background:#C00000'>
<span style='font-size:12.0pt;font-family:"Verdana",sans-serif;color:white'><b> Overview </b></span></p>
<p><span style='font-size:10.0pt;font-family:"Verdana",sans-serif;  color:#171717'>
<!-- INSERSERT YOUR OWN TEXT/DETAILS HERE -->

<p><b>Is an outage expected?:&nbsp;</b>@{outputs('Create_item')?['body/Textfield1']}</p>
<p><b>On what services is the outage expected?:&nbsp;</b>@{outputs('Create_item')?['body/Textfield2']}</p>
<p><b>Start Date and Time:&nbsp;</b>Purposefully Blank </p>

<p><b>End Date and Time:&nbsp;</b>Purposefully Blank </p>

</span></p>
</tr>
</td>
</table>
<!-- FINISH OF OVERVIEW SECTION -->
 

</td>
</tr>
</table>
<p><span style='font-size:10.0pt;font-family:"Verdana",sans-serif;color:black'></span></p>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

 

 

 

I tried:

uriComponentToString(Replace(uriComponent(body('Get Response Details')?['Text field 1']),'%0a','<br/>'))

 

but I got the error 'Correct to include a valid reference to 'Get response details' for the input parameter(s) of action 'Send_an_email_notification_(v3)'. 

 

When I looked this up it looked like a white space issue is the Expression but I can't find the problem. 

 

I have also tried: 

concat(split)(text field 1.text, char(10)),Result & "<br>")

 

But this is an invalid expression. 

 

I hope I've 1)posted in the right place, 2)included enough information for someone to be able to help.

 

Many thanks

Hannah 

1 ACCEPTED SOLUTION

Accepted Solutions
Paulie78
Super User
Super User

This might work for you, based on what you have suggested:

replace(outputs('Create_item')?['body/Textfield2'], decodeUriComponent('%0A'), '<br />' )

But what I would suggest is before your send email action you add a compose with the above expression in it also. You will then easily be able to see what it is generating.

View solution in original post

4 REPLIES 4
Paulie78
Super User
Super User

This might work for you, based on what you have suggested:

replace(outputs('Create_item')?['body/Textfield2'], decodeUriComponent('%0A'), '<br />' )

But what I would suggest is before your send email action you add a compose with the above expression in it also. You will then easily be able to see what it is generating.

Hannah_Hod
New Member

Thats perfect! Thank you so much!

askondo
Community Support
Community Support

@Paulie78 Thank you for always answering the forum. Please continue to help us keep the forum active.

KellyE
Frequent Visitor

I know this is a very old thread, but just wanted to say thank you! I was having the same issue and this solved my problem.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,582)