cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mikemcg360
Level: Powered On

Convert Column to Plain Text and Use in Table

I have tried this a number of ways. I am grabbing a SharePoint list, which has a rich text column. I am trying to convert that to plain text and use it when I build an HTML table. The problem is if I don't create a variable, then when I create my table, I cannot call "the plain text content" that is created in the "for each" action (where the comments column is converted to plain text). 

 

So I have tried to create a variable, if it is a string variable, then it converts to plain text and appends all the comments together as one variable. I tried using the array variable but I am not familiar enough to make this work. Any ideas / work around??

 

Here is my flow...

Flow Screenshot.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Convert Column to Plain Text and Use in Table

 

Hi @mikemcg360 ,

 

Please try the following methods to achieve your needs.

  1. Initialize array variable to store the data that needs to be displayed in the table.
  2. Append the fields that need to be displayed in the table to the array in JSON format.
  3. Then use the array variable as the data source to create the HTML table.

Image reference:

82.PNG

Details in Apply to each:

83.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
CollabTechie
Level 8

Re: Convert Column to Plain Text and Use in Table

 
Super User
Super User

Re: Convert Column to Plain Text and Use in Table

Hi @mikemcg360 

Can you please go to a Flow run and take a screen shot &/or post the JSON from the Get items and tell us the name of the column you are having issues with and I will see if I can recreate?

 

If you find my posts helpful, please mark with thumbs up

 

If this solves your issue, please click "Accept as Solution"

 

Any questions, just ask.

 

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


mikemcg360
Level: Powered On

Re: Convert Column to Plain Text and Use in Table

Hi @AlanPs1 

 

You should be able to recreate with any SharePoint list that has a multiline text column type of Enhanced Rich Text.

 

Type some bulletpoints in the column contents, and then use MS FLOW to try to grab it, convert the text to plain text, and use it when you create an HTML table. 

Super User
Super User

Re: Convert Column to Plain Text and Use in Table

Hi @mikemcg360 

It still would be helpful to see your output, although based on what you have said above:

 

"So I have tried to create a variable, if it is a string variable, then it converts to plain text and appends all the comments together as one variable. I tried using the array variable but I am not familiar enough to make this work. Any ideas / work around??"

 

So sounds like you are getting the plain text.

 

Please see this post.

 

https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-split-a-text-to-a-JSON/m-p/373642#...

 

Assuming you wanted to break on a carriage return and create an array that in turn you could work with, please try something like what's in the post.

 

This is what I would do regularly.

 

If you find my posts helpful, please mark with thumbs up

 

If this solves your issue, please click "Accept as Solution"

 

Any questions, just ask.

 

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


mikemcg360
Level: Powered On

Re: Convert Column to Plain Text and Use in Table

@AlanPs1 

Sorry, didnt paste the code due to some company specific info

 

The JSON split sounds like a pretty complicated way to get my plain text out of the "for each" loop. I guess I could, but I would have to split it on each new list row. There is no specific character to split it on.

 

Community Support Team
Community Support Team

Re: Convert Column to Plain Text and Use in Table

 

Hi @mikemcg360 ,

 

Please try the following methods to achieve your needs.

  1. Initialize array variable to store the data that needs to be displayed in the table.
  2. Append the fields that need to be displayed in the table to the array in JSON format.
  3. Then use the array variable as the data source to create the HTML table.

Image reference:

82.PNG

Details in Apply to each:

83.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

mikemcg360
Level: Powered On

Re: Convert Column to Plain Text and Use in Table

@v-bacao-msft 

 

Beautiful! Thanks a lot. The next bit that tripped me up was calling the column from the array in the "Create_HTML_table" action. For anyone else looking for this solution here is how I did it. 

 

Flow Screenshot.png

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons in April

Read the announcement for more information!

firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,755)