cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

SharePoint rich text field as HTML text in PowerApps incl hyperlinks

I am using PowerApps to view SharePoint list items that have a rich text field that includes hyperlinks, so when I present those fields in PowerApps I have to switch the default text field for an HTML text field and insert "Parent.Default" as the HTML text data.

 

If the hyperlinks in those SharePoint fields point to external web links then all is fine but when those links point to other parts of the same SharePoint site, SharePoint automatically crops the https://sharepointdomain.com part and the link then reads, e.g. /sites/name/sitepages/content.aspx.

 

Since PowerApps was asked to read the SharePoint field exactly, those shortened links don't work. The links are interpreted as https://eu.create.powerapps.com/sites/.../...

 

I am looking for a SharePoint or PowerApps fix here.

 

This query proves very difficult to search for because its keywords are generally used in other contexts so if anyone can remember where a similar discussion took place I'd be happy to go there instead. Thanks for reading!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: SharePoint rich text field as HTML text in PowerApps incl hyperlinks

So this works brilliantly. I will continue to look for a SharePoint fix but I imagine this will work for some time.

 

Thank you so much!

View solution in original post

8 REPLIES 8
Highlighted
Advocate V
Advocate V

Re: SharePoint rich text field as HTML text in PowerApps incl hyperlinks

Thats the beauty (well...) of SharePoint. 🙂

 

What if you run a substitute on the PowerApps side on all links? All Sharepoint links will start with /sites/ which means you can do this:

 

substitute(var_URL,"/sites/","https://yourtenantname.sharepoint.com/sites/")

It will, of course, mess upp correct links that happen to include "/sites/" but that can be prevented by:

 

if("http" in var_URL, var_URL, substitute(var_URL,"/sites/","https://yourtenantname.sharepoint.com/sites/"))

That line will return the url if it already includes "http" and otherwise it will fix the broken url.

 

Quite ugly, but i think it will fly.

Highlighted
Frequent Visitor

Re: SharePoint rich text field as HTML text in PowerApps incl hyperlinks

So this works brilliantly. I will continue to look for a SharePoint fix but I imagine this will work for some time.

 

Thank you so much!

View solution in original post

Highlighted
Advocate V
Advocate V

Re: SharePoint rich text field as HTML text in PowerApps incl hyperlinks

Great!

 

Please mark as solution.

Highlighted
Frequent Visitor

Re: SharePoint rich text field as HTML text in PowerApps incl hyperlinks

I'm  still having problems with this solution. In the HtmlText field I'm using:

 

Substitute(Parent.Default,"/sites/","/https://my site.sharepoint.com/sites/")

 

The is a critical function for my app

 

Thanks in advane

 

 

 

 

Highlighted
Advocate I
Advocate I

Re: SharePoint rich text field as HTML text in PowerApps incl hyperlinks

Thank you,

this Substitute was what I was looking for as my RTF field does cut URL links as stated before.

 

                Substitute(Parent.Default,"/sites/","/https://my site.sharepoint.com/sites/")

 

I hope Microsoft will soon fix the hyperlink issue with SharePoint from PowerApps.

 

Super help

Highlighted
Advocate II
Advocate II

Re: SharePoint rich text field as HTML text in PowerApps incl hyperlinks

Hello @MagnusGöransson 
This solution is working for apps I open in Chrome (and the chromium-based Edge browser). Unfortunately, even though the URL is now fixed, images which are stored in Sharepoint, displayed in a Rich Text Field using the HTML text, are still not visible in my app when I try using the mobile app, windows app or view it in Internet Explorer.

Inspecting the image properties shows it has a correct link (using your proposed substitute fix), as it should. Any ideas???

dnourie_0-1592653413824.png

 

Highlighted
Advocate V
Advocate V

Re: SharePoint rich text field as HTML text in PowerApps incl hyperlinks

Yes, there is a fix for that, but it is also quite ugly. The problem is that the image is not loaded through the connector which means that the app is not authenticated when it load the image. In the browser you are logged on, when using the desktop computer but not when using the mobile device.

You need to force the image to be loaded using the SharePoint connector. That can be accomplished by using this solution described here: https://powerusers.microsoft.com/t5/Building-Power-Apps/Uploading-images-to-SharePoint-list-without-...

Highlighted
Post Patron
Post Patron

Re: SharePoint rich text field as HTML text in PowerApps incl hyperlinks

I realize you say to run this on the PowerApps side but my content is pulling from a SharePoint list.  Where am I to add this variable?  

Thank you. 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,856)