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

 

@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

@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

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,590)