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 / replace Newline \n wit...
Power Automate
Unanswered

replace Newline \n with in Sharepoint item column before creating a file

(0) ShareShare
ReportReport
Posted on by 232

Hi All,

 

At the moment I'm trying to improve the structure of my app and flows a bit and I'm curious...

Is it possible to retrieve the column data (Multiline) for a selected item, and use the replace funtion to replace Newlines \n to html <br> and then output this changed text?

 

For the sake of context, I'm presently creating .txt files from a sharepoint list item, but I want to see if it's possible to create a working .jsx script I can trigger within Adobe Indesign.

 

I feel like I'm close, but I can't quite work my head around it.

Categories:
I have the same question (0)
  • cfebvre Profile Picture
    232 on at

    For added detail:

    I want to manipulate the 'BodyCopy' Dynamic content below to replace all insatnces of \n with <br>

    The dynamic content I want to manipulate.The dynamic content I want to manipulate.An example of the \n newline I want to replace with <br>An example of the \n newline I want to replace with <br>

  • Verified answer
    v-bacao-msft Profile Picture
    on at

     

    Hi @cfebvre ,

     

    Please check this similar thread and see if it helps:

    https://powerusers.microsoft.com/t5/Building-Flows/How-to-print-a-row-with-new-line-character-from-excel-to-teams/td-p/349942

    Note that you need to add a space bar to the value of Variable.

    Hope it helps.

     

    Best Regards,

  • cfebvre Profile Picture
    232 on at

    Hi @v-bacao-msft,

     

    Thanks for getting back to me. I'm attempting your solution but not having success at the moment - my expression is invalid.

    I'm using the compose action prior to the create file action and attempting to use a replace expression:

    replace(@{body('Get_item')?['BodyCopy']},'\n','<br>')
    I'm inputting this expression, but it says its invalid.I'm inputting this expression, but it says its invalid.
    I'm then using the output from this action to create the .jsx file content.
    As you can see, I'm trying to replace all instances of '\n' with '<br>' within the BodyCopy dynamic content I retrieve earler in the flow. 
    I'm a bit hopeless at expressions, and I expect I've got this terribly wrong.
    I notice in the example you provided, the expression isn't typed in the expression field, uses and @ symbol at the beginning, and is encased in quotes.
  • v-bacao-msft Profile Picture
    on at

     

    Hi @cfebvre ,

     

    I used the variable, you don't seem to use it here, please follow the method I provided to configure the Expression.

    Like:

    replace(body('Get_item')?['BodyCopy'],variables('Enter'),'<br>')

    Best Regards,

     

  • cfebvre Profile Picture
    232 on at

    Hi @v-bacao-msft ,

     

    You're a champ as usual! I completely misunderstood what you meant the first time round, but this has fixed my problem entirely.

     

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