cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
T_A_M
Helper IV
Helper IV

Replace a delimiter with a line break when composing HTML?

I'm working on a flow that is triggered when a new item is created in a Sharepoint list. 

 

I have a Compose action that includes HTML that I'm using to make a PDF report. One of the columns in my Sharepoint list includes a series of names separated by semicolons:

 

Person 1; Person 2; Person3, etc. 

 

The column type is "multiple lines of text" (plain text). When I include that field in my HTML as dynamic content, I want it to be formatted with line breaks after each name instead of the semicolons, like this:

 

Person 1

Person 2

Person 3

 

Any suggestions would be greatly appreciated. Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
vivekpande18
Super User
Super User

Hi @T_A_M ,

 

Please find below steps.

 

1- Initialize variable - HTML

vivekpande18_0-1652877722841.png

2- Compose action to hold semicolon values from your list. I have taken hard coded value

vivekpande18_1-1652877795913.png

3- Loop over the person values 

vivekpande18_2-1652877826040.png

Input : split(outputs('Compose_-_Semicolon_Delimited_Value'),';')

split the compose value by semicolon.

 

4- Append value in string variable

vivekpande18_3-1652877914154.png

5 - Now append the string outside of apply to each loop

vivekpande18_4-1652877962729.png

 

6 - Add the above variable value in your html.

 

Output:

 

vivekpande18_5-1652878024858.png

 

The entire flow

 

vivekpande18_6-1652878079463.png

 

 

Thanks

Vivek Pande

 

If this post helps answer your question, please click on "Accept as Solution" to help others find it more quickly.

if you thought this post was helpful, please give it a Thumbs Up

View solution in original post

2 REPLIES 2
vivekpande18
Super User
Super User

Hi @T_A_M ,

 

Please find below steps.

 

1- Initialize variable - HTML

vivekpande18_0-1652877722841.png

2- Compose action to hold semicolon values from your list. I have taken hard coded value

vivekpande18_1-1652877795913.png

3- Loop over the person values 

vivekpande18_2-1652877826040.png

Input : split(outputs('Compose_-_Semicolon_Delimited_Value'),';')

split the compose value by semicolon.

 

4- Append value in string variable

vivekpande18_3-1652877914154.png

5 - Now append the string outside of apply to each loop

vivekpande18_4-1652877962729.png

 

6 - Add the above variable value in your html.

 

Output:

 

vivekpande18_5-1652878024858.png

 

The entire flow

 

vivekpande18_6-1652878079463.png

 

 

Thanks

Vivek Pande

 

If this post helps answer your question, please click on "Accept as Solution" to help others find it more quickly.

if you thought this post was helpful, please give it a Thumbs Up

That worked perfectly. Thank you!

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,222)