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

HTMLText (Table) into Microsoft Word Template - how to keep formatting

Hello - I've got an HTMLText in my PowerApp that displays colors depending on the number.  

2020-05-27_16-53-12.jpg

 

 

 

 

 

 

 

 

"<!DOCTYPE html>
<html>
<body>
<Table width='100%' border='1' cellpadding='5' style='border:0px solid black; border-collapse:collapse'>" &
"<tr style='background-color:#efefef'>
<td align='left'><b>Leadership and Management</b></td>
<td align='left'><b>"&'L&M-Total'.Text&"<b></td>
</tr>"
& Concat(Filter(collCAPReport, Component.Value = "a. Leadership and Management"), "<tr><td>" & Title & "</td><td><font color="""&If(Answer="1", "Red", Answer="2", "LightCoral", Answer="3", "DarkGoldenRod", Answer="4", "LightGreen", Answer="5", "Green")&""">" & Answer & "</font></td></tr>")&
"
</table>
</body>
</HTML>
"

 

The Table is generated from a collection that has two rows: Title and Answer. 

 

I'm hoping to get this exact table (with colors) into a Template Word Document.

 

I know that you can't insert the HTML into the Word Template at this time (boo), but so far I've got the following: 

  - I'm thinking we're close using this the repeating method:  - https://www.youtube.com/watch?v=-1jsBllmr-w.

  - Is there something in PowerApps or Flow that I can apply a similar If statement that gets color?

  - On the Word side of the house, I read some stuff about Merge and */char, but I'm thinking Flow/PowerApps maybe easier?

 

You talking to a bit of a noob here, but would really appreciate any assistance. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @Specoop ,

Do you want to populate the HTML Text from your canvas app to a Microsoft Word Template through Power Automate flow?

 

Based on the needs that you mentioned, I afraid that there is no way to achieve your needs. Currently, the Rich Text Content Control is not supported under Microsoft Word (Business) connector, so there is no control could render the HTML Text within Microsoft Word Template .

Please check the following article for more details:

https://docs.microsoft.com/en-us/connectors/wordonlinebusiness/#known-issues-and-limitations

 

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider generate PDF file based on your HTML text instead of Word file in your OneDrive folder. I have made a test on my side, please consider take a try with the following flow's configuration:

9.JPG

Then within your canvas app, set the Html Text property of the Html Text control (HtmlText1) to following:

"<!DOCTYPE html>
<html>
<body>
<Table width='100%' border='1' cellpadding='5' style='border:0px solid black; border-collapse:collapse'>" &
"<tr style='background-color:#efefef'>
<td align='left'><b>Leadership and Management</b></td>
<td align='left'><b>"&'L&M-Total'.Text&"<b></td>
</tr>"
& Concat(Filter(collCAPReport, Component.Value = "a. Leadership and Management"), "<tr><td>" & Title & "</td><td><font color="""&If(Answer="1", "Red", Answer="2", "LightCoral", Answer="3", "DarkGoldenRod", Answer="4", "LightGreen", Answer="5", "Green")&""">" & Answer & "</font></td></tr>")&
"
</table>
</body>
</HTML>
"

Then add a button, set the OnSelect property to following (press it to fire flow action😞

'Flow Name'.Run(HtmlText1.HtmlText)

 

Please consider take a try with above alternative solution, then check if it could help in your scenario.

 

Best regards,

Community Support Team _ Kris Dai
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

1 REPLY 1
Highlighted
Community Support
Community Support

Hi @Specoop ,

Do you want to populate the HTML Text from your canvas app to a Microsoft Word Template through Power Automate flow?

 

Based on the needs that you mentioned, I afraid that there is no way to achieve your needs. Currently, the Rich Text Content Control is not supported under Microsoft Word (Business) connector, so there is no control could render the HTML Text within Microsoft Word Template .

Please check the following article for more details:

https://docs.microsoft.com/en-us/connectors/wordonlinebusiness/#known-issues-and-limitations

 

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider generate PDF file based on your HTML text instead of Word file in your OneDrive folder. I have made a test on my side, please consider take a try with the following flow's configuration:

9.JPG

Then within your canvas app, set the Html Text property of the Html Text control (HtmlText1) to following:

"<!DOCTYPE html>
<html>
<body>
<Table width='100%' border='1' cellpadding='5' style='border:0px solid black; border-collapse:collapse'>" &
"<tr style='background-color:#efefef'>
<td align='left'><b>Leadership and Management</b></td>
<td align='left'><b>"&'L&M-Total'.Text&"<b></td>
</tr>"
& Concat(Filter(collCAPReport, Component.Value = "a. Leadership and Management"), "<tr><td>" & Title & "</td><td><font color="""&If(Answer="1", "Red", Answer="2", "LightCoral", Answer="3", "DarkGoldenRod", Answer="4", "LightGreen", Answer="5", "Green")&""">" & Answer & "</font></td></tr>")&
"
</table>
</body>
</HTML>
"

Then add a button, set the OnSelect property to following (press it to fire flow action😞

'Flow Name'.Run(HtmlText1.HtmlText)

 

Please consider take a try with above alternative solution, then check if it could help in your scenario.

 

Best regards,

Community Support Team _ Kris Dai
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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (10,294)