in PowerApps, SharePoint

A simple fix to load high resolution profile pictures from SharePoint in PowerApps

In your PowerApp app, when you bind an Image control to a Picture property from a Person Field in SharePoint, by default it will display the low resolution small sized profile photo.

App with low-resolution profile pictures

App with low-resolution profile pictures

If you explore the URL string that is returned by the Picture property, you will clearly see why:

https://contoso.sharepoint.com/teams/ContosoRecruiting/_layouts/15/UserPhoto.aspx
?&Size=S&AccountName=demo@contoso.com

It requests the Small size version of the photo.

While you can’t change the value returned back from SharePoint, you can easily replace the string Size=S with Size=L so the Image control can load the large image instead.

Select the Image control and then use the following for the Image property:

Replace(ThisItem.Candidate.Picture, 
  Find("Size=S", ThisItem.Candidate.Picture), 
  6, "Size=L")
Replace query to load high res profile pictures

Replace query to load high res profile pictures

This will now load the large size!

App with low-resolution profile pictures

App with high-resolution profile pictures

p.s. Yes, I have already reported this bug so we will work on fixing this soon!

Write a Comment

Comment

Time limit is exhausted. Please reload the CAPTCHA.