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.
Here is now the data shows in Sharepoint with line breaks
And the email that is generated with no line breaks
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'> </p>
<p> </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?: </b>@{outputs('Create_item')?['body/Textfield1']}</p>
<p><b>On what services is the outage expected?: </b>@{outputs('Create_item')?['body/Textfield2']}</p>
<p><b>Start Date and Time: </b>Purposefully Blank </p>
<p><b>End Date and Time: </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
Solved! Go to Solution.
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.
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.
Thats perfect! Thank you so much!
@Paulie78 Thank you for always answering the forum. Please continue to help us keep the forum active.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
66 | |
23 | |
16 | |
16 | |
13 |
User | Count |
---|---|
116 | |
35 | |
32 | |
28 | |
26 |