cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnjohn123
Super User
Super User

Unable to figure out how i can add a new line inside string variable

I have created a string variable as follow:-

 

v1.png

 

then i am appending its text using the built-in "Append to string variable" action >> this action will be performed inside "foreach" for this action will get performed 1++ times:-

 

v2.png

 

finally i will updated the item with the final variable string, as follow:-

 

v3.png

 

now this is working but the only issue i am facing is that the variable will show the entries without new lines. as follow:-

 

444.png

 

so is there a way to fix this?

5 REPLIES 5
Expiscornovus
Super User
Super User

Hi @johnjohn123

 

A possible workaround would be to initialize a variable for a carriage return and append that in your apply to each.

 

1. Add a initialize variable action, call it CRLF and press enter in the value so you have two lines

crlf_inivariable.png

2. Add the CRLF variable to your append to string action

crlf_append.png

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


@Expiscornovushave you tried it at your end..? because adding this extra variable will not have any effect!

 

Expiscornovus
Super User
Super User

Hi @johnjohn123,

 

Yes, I tested it first before I posted this possible solution 🙂

 

What kind of SharePoint column are you using, multiple lines of text?

 

My test result

test_crlfupdateitem.png

Output of my test example in a compose action

test_compose_crlf.png

 

Output of my test example in an SharePoint Update item action

test_sharepoint_crlf.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


@Expiscornovus  i am using Rich Text field + i changed it to Enhanced rich text field,,,but still same issue..

thanks

Expiscornovus
Super User
Super User

@johnjohn123 can you share the output (a couple of screenshots) of your flow test before you changed the field to use enhanced rich text?

 

Btw, I just tested it on my target list with an enhanced rich text field. The solution I proposed doesn't work with an enhanced rich text field. Look at the example below.

 

enhancedtoggle_doesntwork.png

 

enhancedrichtext.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Helpful resources

Announcements
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.

Users online (1,618)