PowerApps: rendering images from SharePoint Online in Rich Text Column

Why?

By default a PowerApp will not render images for a Multiple lines of text column if the image is stored in SharePoint Online 🤔

What?

This post will give you a pretty straight forward option on how you can get this to work.

How?

So there is a SharePoint list (ListHTML) where we will add items, in this list there is a Multiple lines column (MultipleLinesRichText) where we will add Enhanced rich text with things like images and formatted (HTML) text.

1) When we add an HTML text control to a PowerApp and reference it to the Multiple lines column with some images in it:

First(ListHTML).MultipleLinesRichText

It will not show the image stored in SharePoint Online because it somehow does not receive the full link of the SharePoint stored image. We can see this when we reference the same column in a Label control:

2) We can simply make sure that any reference to your SharePoint tenant is “complemented” using the Substitute function:

Substitute(First(ListHTML).MultipleLinesRichText,"src="&"""/","src="&""""&"https://[Your Tenant URL Name].sharepoint.com/")

Another formula with the same effect using the Char(34) option instead of the double quote escape:

Substitute(First(ListHTML).MultipleLinesRichText,"src="&Char(34)&"/","src="&Char(34)&"https://[Your Tenant URL Name].sharepoint.com/")

This way you make sure that any SharePoint reference will be complemented to a full valid URL and then PowerApps is able to render it, like it would show any online image:

Leave a comment