web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Populating HTML in Pow...
Power Apps
Unanswered

Populating HTML in PowerApps from template in SharePoint list

(0) ShareShare
ReportReport
Posted on by 19

Hello all,

I'm trying to create an app where users can see announcements. The announcements are sent to us in HTML format, so I created a list in SharePoint with Subject and Body columns. The Body column is formatted as Enhanced Rich Text, so I pasted the HTML code in here.

In PowerApps, I created Gallery1 that shows the Subject and Created date for the announcement, and Gallery2 with an HTML Text box with Gallery1.Selected.Body in the Text Property. 

The idea is for PowerApps to "read" the code on Gallery2 depending on what announcement you select in Gallery1, and therefore, to display the announcement as you may see it in Outlook, for example. But right now, is just displaying the HTML text in the SharePoint list, and is not reading the code.

 

HTML code in Body column in SharePoint list:

 

<p style="text-align: center;"><img src="https://xxxxx.xxxx-xxxx.com/:i:/r/sites/XXXXxxxxxxx/communications/Shared%20Documents/Images%20for%20Templates/Test1/UAM%20logo.png?csf=1&amp;web=1&amp;e=GewLUc" alt="" width="288" height="160" /></p>
<p style="text-align: center;">&nbsp;</p>
<p><strong>Congratulations! This is a test.</strong></p>
<p>&nbsp;</p>
<p>Announcements are sent in HTML format by our design company and therefore, the code should be read by PowerApps from a SharePoint list as its main source.</p>
<p>&nbsp;</p>
<p><span style="color: #ff0000;"><strong>Thank you and good luck!</strong></span></p>

 

SharePoint List:

BellatrixUAM_0-1611942719902.png

 

How it looks in PowerApps right now:

 

BellatrixUAM_1-1611942926279.png

How it should look Gallery2 in PowerApps:

 

BellatrixUAM_2-1611942971303.png

 

Thank you so much for all your help!

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @BellatrixUAM ,

    You need single quotes for HTML code

    "<p style='text-align: center;'><img src='https://xxxxx.xxxx-xxxx.com/:i:/r/sites/XXXXxxxxxxx/communications/Shared%20Documents/Images%20for%2...' alt='' width='288' height='160' /></p>
    <p style='text-align: center';>&nbsp;</p>
    <p><strong>Congratulations! This is a test.</strong></p>
    <p>&nbsp;</p>
    <p>Announcements are sent in HTML format by our design company and therefore, the code should be read by PowerApps from a SharePoint list as its main source.</p>
    <p>&nbsp;</p>
    <p><span style='color: #ff0000;'><strong>Thank you and good luck!</strong></span></p>"

    WarrenBelz_0-1611959204626.png

    I do not have your image, but the rest works fine.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

  • BellatrixUAM Profile Picture
    19 on at

    Hi @WarrenBelz 

    I added the single quotes to the HTML code in the Body column of the SharePoint List and still is not working.

     

    This is how is being displayed in Power Apps:

     

    BellatrixUAM_0-1612472859110.png

     

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @BellatrixUAM ,

    Can you please post that code in Text - I can still see a heap of double quotes in there.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • BellatrixUAM Profile Picture
    19 on at

    Hi @WarrenBelz 

     

    The code I used and added in the Body column of SharePoint list is:

     

    '<p><strong>Congratulations! This is a test.</strong></p>
    <p>&nbsp;</p>
    <p>Announcements are sent in HTML format by our design company and therefore, the code should be read by PowerApps from a SharePoint list as its main source.</p>
    <p>&nbsp;</p>
    <p><span style="color: #ff0000;"><strong>Thank you and good luck!</strong></span></p>'

     

    I took the picture off because I do not want to over complicate this. 

    This is how it looks in SharePoint:

    BellatrixUAM_0-1612475084641.png

     

    And this is how it looks in PowerApps:

    BellatrixUAM_1-1612475113637.png

    Thank you!

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @BellatrixUAM ,

    You need the double quotes enclosing it to signify it is text and single inside

    "<p><strong>Congratulations! This is a test.</strong></p>
    <p>&nbsp;</p>
    <p>Announcements are sent in HTML format by our design company and therefore, the code should be read by PowerApps from a SharePoint list as its main source.</p>
    <p>&nbsp;</p>
    <p><span style='color: #ff0000;'><strong>Thank you and good luck!</strong></span></p>"
    

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • BellatrixUAM Profile Picture
    19 on at

    Hi @WarrenBelz 

    I'm sorry but I'm not get it. I tried with double quotes first by putting them in the code in the sharepoint column, still it was not read in the HTML in PowerApps. Then, you told me it should be single quotes, so I changed it and put them in the code in the SharePoint list, still as per my previous screenshots, PowerApps is not recognizing it.

    So now... should I put double quotes again? Should I put them in the SharePoint list column directly like "<p><strong>Congratulations! This is a test.</strong></p>
    <p>&nbsp;</p>..."

    Or should I put the double quotes directly in PowerApps like "&Gallery2.Selected.Body&"

    I appreciate your clarification.

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    @BellatrixUAM ,

    Can you please look at the code I posted both times. The whole code needs to be enclosed in double quotes (at the start and end only) as it is a text string. Howeveranywhere double quotes would normally be used inside the HTML code (around the Color in this case)

    <p><span style='color: #ff0000;'><strong>Thank you and good luck!</strong></span></p>

    needs to be single quotes.

    You also had a number of others in your original post

    <p style='text-align: center;'>
    <img src='https://xxxxx.xxxxxxxx.com/:i:/r/sites/XXXXxxxxxxx/communications/Shared%20Documents/Images%20for%2...' alt='' width='288' height='160' /></p>
    <p style='text-align: center';>&nbsp;</p>

    If you simply paste the code I provided in the first one, it should work for you.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • BellatrixUAM Profile Picture
    19 on at

    Hello @WarrenBelz 

    I did that, and still is not working:

     

    BellatrixUAM_0-1612543275892.png

    I changed the text code to: 

    "<p><strong>Congratulations! This is a test.</strong></p>
    <p>&nbsp;</p>
    <p>Announcements are sent in HTML format by our design company and therefore, the code should be read by PowerApps from a SharePoint list as its main source.</p>
    <p>&nbsp;</p>
    <p><span style='color: #ff0000;'><strong>Thank you and good luck!</strong></span></p>"

    🤔

  • WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    Hi @BellatrixUAM ,

    I assume you are putting this is a HTML Text box - please see below

     

    HTMLText2.png

    Here is is below in HTML in the post itself

     

    Congratulations! This is a test

    Announcements are sent in HTML format by our design company and therefore, the code should be read by PowerApps from a SharePoint list as its main source

    Thank you and good luck!

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • BellatrixUAM Profile Picture
    19 on at

    Hi @WarrenBelz 

    Yes, is a HTML text box inside a gallery in PowerApps:

     

    BellatrixUAM_0-1612559764472.png

     

    The column in SharePoint (from where the code should be taken) is in enhanced rich text format:

    BellatrixUAM_1-1612559849167.png

     

    Thank you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard