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
Impactful Individual
Impactful Individual

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
Impactful Individual
Impactful Individual

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,672)