cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Aragorn911
Level: Powered On

Display image from Sharepoint Library. Authentication Problem?

Hello,

 I Have an app that loads Images from Sharepoint Library. Images are in a gallery and It works fine when developping the app.

 

However, when its deployed to new devices, the images doesn't show. The only way to make them show is by opening a new tab and opening the sharepoint site which the document library resides in.  (And this is not a one time process. You have to keep doing it from time to time)

 

This is not practical when deplying the app to a large number of devices. 
 What is causing this issue and how can i Fix it?

 

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Newbie2019
Level 8

Re: Display image from Sharepoint Library. Authentication Problem?

Hi @jsantan73 

I can confirm that I have just changed 600 images to URI and they now load from my sharepoint list on all devices (Android / IOS) for all users.

View solution in original post

15 REPLIES 15
Community Support Team
Community Support Team

Re: Display image from Sharepoint Library. Authentication Problem?

Hi @Aragorn911,

 

How did you set in PowerApps to make the image show? Did you set below formula in the Image property of the Image control inside the Gallery control?

 

 ‘{Link}’ 

If so, then it is known that this only works in the web version of PowerApps - not on devices. To make it work on devices,  you could try to convert the SharePoint images to its URI (Uniform Resource Identifier) form and bind the image control to that. The URI is basically a long text representation of the image/picture.
Do the following:

  • In SharePoint, create an additional text column in my library and named it 'imageDataUri'
  • In Microsoft Flow, I created a Flow that fires whenever a new SharePoint list item is created, checks to see if the list item is an image (based on the file extension), and if it is, converts its content to its URI format and saves the text in the list items 'imageDataUri' field
  • In PowerApps, instead of binding my image control to the SharePoint image URL, I bound it to the data URI field of the list item instead.

Below is the marked key section of my Flow that does the conversion to the URI format:

flowsp2.png

 

The formula looks as follows:

dataUri(binary(body('Get_file_content')))

The body('Get_file_content') is a reference to the previous step in which you need to fetch the actual content of the file (image in my case) from SharePoint.

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Aragorn911
Level: Powered On

Re: Display image from Sharepoint Library. Authentication Problem?

Thank you for the Reply!

 

 er... I Think i failed to mention something..

Well the Images are in a Document Library. But There is a Sharepoint List that has a column called "ImageURL" which contains the URL's of the images in the document library. 

 Ex:
 /*mysite*/Shared%20Documents/Images/1.jpg
 /*mysite*/Shared%20Documents/Images/2.jpg


So inside powerapps, what im doing is just adding a Media > Image

 and for the IMAGE property, im saying "Thisitem.ImageURL

 

shouldn't this work? 
😕

 

And for your method, wouldn't DataURI's size be large as the image's size? 

And I have alot of images in the Document library. 
 The app is just Retrieving the Image related to a dropdown box selection.
Maybe we can use Flow to retrieve the image from the document library using ur method?

 

Thank you again..!

Aragorn911
Level: Powered On

Re: Display image from Sharepoint Library. Authentication Problem?

No Solutions?

jsantan73
Level: Powered On

Re: Display image from Sharepoint Library. Authentication Problem?

Hey Aragorn- did you ever find a solution to this? I am having the same troubles as you did with my app.

Newbie2019
Level 8

Re: Display image from Sharepoint Library. Authentication Problem?

Hi @jsantan73 

I can confirm that I have just changed 600 images to URI and they now load from my sharepoint list on all devices (Android / IOS) for all users.

View solution in original post

JMAFO
Level: Powered On

Re: Display image from Sharepoint Library. Authentication Problem?

Using the flow to convert the image to URI is extremely slow and causes the image library to no longer open up.. is this expected behavior?

Newbie2019
Level 8

Re: Display image from Sharepoint Library. Authentication Problem?

Hi @JMAFO , I had issues with using flow and an image library so placed them all in a standard sharepoint list. The column type is multiple line of text.

 

I used an online convertor as flow was to slow.

 

Cheers

JMAFO
Level: Powered On

Re: Display image from Sharepoint Library. Authentication Problem?

@Newbie2019 thanks for the reply! So to get this clear, you used a standard SharePoint list with the multi line column that stored the data uri and then connected to that list via PowerApps data connection? Did you include the images as attachments on the list?

Newbie2019
Level 8

Re: Display image from Sharepoint Library. Authentication Problem?

@JMAFO Yeah, use a standard SharePoint list with a multiline column. I simply click to add a new entry and paste the into that column. For example I called my multi column imageDataURI as below:

URI.JPG

 

I then display the mage in powerapps gallery by doing a lookup based on a name which is displayed against the URI in the title column.

 

Let me know if this works.

 

Cheers

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,467)