cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Sharepoint Images to Gallery in Powerapps

I've seen this post below, but cannot get the flow to succeed and I don't know why.  Can anyone give a concrete example of this working?  The blanks and missing information because people assume I know what I'm talking about drive me nuts.  But I would really like to get this up and running.  The current work arounds to get a image to show in a gallery in powerapps from a sharepoint library or list are terribly complex for what should be a simple task.

 

Previous Post in Forum:

 

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?

 

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.

 

---------

 

Something's missing here, but I'm not sure what, any help would be great.  It is infuriating being so close to a solution and it not working.  Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate II
Advocate II

And I solved it minutes later...  I wasn't paying attention to the fact that Single Line text obviously wouldn't be big enough to fit the uri code.

 

I've adjusted the statement below:

 

Do the following:

 

  • In SharePoint, create an additional Multiline 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.

------------

 

I'll add that this works great now, compatible with Android and Web.  I can bring up galleries of images saved to sharepoint document libraries and sort/filter accordingly.

View solution in original post

4 REPLIES 4
Highlighted
Advocate II
Advocate II

And I solved it minutes later...  I wasn't paying attention to the fact that Single Line text obviously wouldn't be big enough to fit the uri code.

 

I've adjusted the statement below:

 

Do the following:

 

  • In SharePoint, create an additional Multiline 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.

------------

 

I'll add that this works great now, compatible with Android and Web.  I can bring up galleries of images saved to sharepoint document libraries and sort/filter accordingly.

View solution in original post

Highlighted
Frequent Visitor

Why didn't I think of this before?! Brilliant workaround and only needs to call on Flow once instead of every image view like using the Floxy method. Kudos!

Highlighted

good video made by this guy.

 

https://www.youtube.com/watch?v=2QeOILfo1Bw

Highlighted

Can you explain the steps/functions used to check if the attachment is an image and convert to URI? Thanks!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,888)