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 / Preserve multi-line br...
Power Automate
Unanswered

Preserve multi-line breaks in email message from a Sharepoint column

(1) ShareShare
ReportReport
Posted on by 78

Hi all,

 

I have searched various answers on this subject, but none help my issue.

 

I have a workflow set up to send an email message which includes the name of a folder/hyperlink combo, and contains information as in who the folder relates too (another column in Sharepoint library).

 

I have a 3rd column which is called Notes. This field is used to add additional text. The field is set to multi-line, so in the Sharepoint Library it will look something like below:

buro2020_0-1605179581848.png

 

So when my automated flow runs, my email ends up looking like below:

buro2020_1-1605179694927.png

 

Basically, it does not preserve the line breaks. I would like it to preserve the line breaks, could someone guide me in setting it up please.

 

my flow below as it stands:

buro2020_2-1605179916453.png

flow2.JPGflow3.jpg

 

The fields are filled in btw, just white out.

 

any help would be great on this.

 

NB. I don't have full admin rights to Sharepoint at my organisation, so I am limited to being a normal user.

Also I am using Microsoft Power Automate for flow design and implementation and Sharepoint of Office 365.

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at

    I think the issue is that your email is HTML and your sharepoint text is plain text. Therefore the link breaks are newlines ( \n). 

     

    So you need to do a replace and replace the new lines with html <br> in the email step. So it would be something like (and I am guessing a bit here).

    replace(outputs('Get_File_Properties')['notes'], '\n', '<br>')

    The '\n' might not do anything for you, sometimes it is easier to create a compose step called "newLine" and just enter a newline character into it. Then change the replace to something like:

    replace(outputs('Get_File_Properties')['notes'], outputs('newLine'), '<br>')

     

    But the concept should retain your line breaks, you might have to tweak a little bit. 

     

  • buro2020 Profile Picture
    78 on at

    Hi Paulie,

     

    Thanks, but neither worked even with tweaks, it wasn't recognising 'Notes' the column name and kept flagging errors. I tried compose and it did not like the name newLine, so had to tweak to accept Compose action to allow me to run the test and met with error message: 

     

    error.JPG

     

    I got invalid templates with various versions of the tweaked replace expression in the email body.

    the \ n  did nothing as you said, something I am doing wrong somewhere.
    Put the column notes does exist, and my previous flow worked in pulling the metadata from that column into an email, but take out my notes field in the email body and nothing works.

  • Paulie78 Profile Picture
    8,422 Moderator on at

    can you create a compose step, with just the notes in it, nothing else. Then run it, go into the run history and show me what comes up. 

  • buro2020 Profile Picture
    78 on at

    Same as before. I have a feeling it is something to do with the get file properties part in the replace expression that might be causing it.

  • Paulie78 Profile Picture
    8,422 Moderator on at

    That's probably because I  made a typo. Try:

    replace(outputs('Get_file_properties')['notes'], outputs('newLine'), '<br>')

    But I could get the whole thing right first time if you would post the outputs of the "Get_file_properties" action and post it back here. You can blank out anything sensitive.

     

    To get the outputs you need to go into the run history and find the outputs section of the get file properties action.

  • buro2020 Profile Picture
    78 on at

    so this is the body of outputs from get properties 

     

    {
    "@odata.etag": "\"2\"",
    "ItemInternalId": "",
    "ID": ,
    "Modified": "2020-11-11T17:22:17Z",
    "Editor": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Claims": "i:0#.f|membership|",
    "DisplayName": "",
    "Email": "",
    "Picture": "https://sharepoint.com/sites/15/UserPhoto.aspx?Size=L&AccountName=",
    "Department": "PDM",
    "JobTitle": ""
    },
    "Editor#Claims": "i:0#.f|membership|",
    "Receivedfrom": "PMA-traffic",
    "notes": "Please find attached the swept path analysis for the HS2. A bit tight passing some of the columns, but works. The column with the red cloud marking will need to be removed / moved. In and outbound movements are on layers ATR01 and ATR02 respectively.\n\nWith regards the sections you supplied, the height clearances for vehicles entering the basement car park are fine - 3.0m at the entrance to the ramp, 2.9m pinch point on the way down the ramp and 3.8m within the car park.,
    "Created": "2020-11-11T17:21:47Z",
    "Author": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
    "Claims": "i:0#.f|membership|",
    "DisplayName": "",
    "Email": "",
    "Picture": "https://sharepoint.com/sites/_layouts/15/UserPhoto.aspx?Size=L&AccountName=",
    "Department": "PDM",
    "JobTitle": ""
    },
    "Author#Claims": "i:0#.f|membership|",
    "OData__DisplayName": "",
    "{Identifier}": "03_Incoming%252fPMA-Traffic,
    "{IsFolder}": true,
    "{Thumbnail}": {
    "Large": null,
    "Medium": null,
    "Small": null
    },
    "{Link}": "https://sharepoint.com/sites/03_Incoming/PMA-Traffic/,
    "{Name}": "201030 Swept path analysis for the HS2",
    "{FilenameWithExtension}": "201030 Swept path analysis for the HS2",
    "{Path}": "03_Incoming/PMA-Traffic/",
    "{FullPath}": "03_Incoming/PMA-Traffic/201030 Swept path analysis for the HS2",
    "{ContentType}": {
    "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedContentType",
    "Id": "",
    "Name": "Folder"
    },
    "{ContentType}#Id": "",
    "{IsCheckedOut}": false,
    "{VersionNumber}": "1.1"
    }

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard