cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dorinda
Super User
Super User

Displaying images on mobile from a SharePoint photo library

@WarrenBelz 

 

Greetings, I was using your blog post about displaying images on a mobile device and got it to work, however,  how can I apply your code to this so that I can leave my images in the separate library and not have to attach them individually to each item in a list.

 

This is the code on the gallery I have been using when it was able to just use the PC now I need to to be available on other devices.

 

/*Filter(
    AssetPhotos,
    Station = Gallery4_2.Selected.Station && AssetClass = "Circuit Switcher" && 'Asset Location'= Gallery4_2.Selected.'Asset Position'
)*/

First(Gallery4_2.Selected.Attachments)

The committed out code is what I have been using and your code is below.  I would like to combine them.

 

Is this possible

1 ACCEPTED SOLUTION

Accepted Solutions

@Dorinda ,

Two examples below - inside the gallery (Note galWorkPhotos here would be your Gallery5_2)

WarrenBelz_0-1649118864049.png

Outside the gallery

WarrenBelz_1-1649118890609.png

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

 

View solution in original post

14 REPLIES 14
WarrenBelz
Super User
Super User

Hi @Dorinda ,

Those two bits are for different storage methods - the top is referring to a Library file and the second to a List attachment. I am a little unclear on your question - the top code is filtering for Library metadata fields to find a set of photos (assmume for a gallery) and the second is looking for the first photo attached to the List. What exactly are you trying to do?

Dorinda
Super User
Super User

@WarrenBelz 

 

Basically I have a gallery on the screen that lists all of the information for a specific asset type, originally I was using a seperate photo library with metadata that I was looking up the information from the first and filtering, like it shows above, however it was not displaying that way on the ipad,  So I took your approach for the second and it works great.  The issue is i really do not want to attach thousands of pictures to individual list items if i do not have to and want to see if I can use your approach to continue using my AssetPhotos with the lookup code above but integrate it so it will show in IOS.

Hi @Dorinda ,

The Image property you need is 

ThisItem.'{Thumbnail}'.Large

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

@WarrenBelz 

 

So this is what I have at the moment, it is all based on the pictures being associated to a list item.  I want to keep the photos in the AssetPhotos library and do the lookup, but when I try it breaks everything.

 

Dorinda_0-1649108551047.png

This code is based on the attachment in a list

First(Gallery4_2.Selected.Attachments)

This is on the image control

 

Gallery5_2.Selected.Value

 

I want to keep using the AssetPhotos library

Filter(
    AssetPhotos,
    Station = Gallery4_2.Selected.Station && AssetClass = "Circuit Switcher" && 'Asset Location'= Gallery4_2.Selected.'Asset Position'
)

But when i uncommit it out it breaks

Hi @Dorinda ,

On the Image you need

LookUp(
   AssetPhotos,
   ID = Gallery4_2.Selected.ID
).'{Thumbnail}'.Large

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

so this is what I am seeing now

Dorinda_0-1649109197431.png

 

No thumbnail in the gallery and nothing displaying in the image control

 

This is on Gallery5_2

Filter(
    AssetPhotos,
    Station = Gallery4_2.Selected.Station && AssetClass = "Circuit Switcher" && 'Asset Location'= Gallery4_2.Selected.'Asset Position'
)

 

its not working

@Dorinda ,

Can we please regroup here as this is a simple process if I can understand exactly what you want to do. If you have a gallery with the Items based on a SharePoint Library (which you do), then inside the Library, an Image will be

ThisItem.'{Thumbnail}'.Large

If the Image is outside the Library (forget about the Lookup posted earlier), it will be

Gallery5_2.Selected.'{Thumbnail}'.Large

One proviso - I am assuming that this is an image (jpg/png) file.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

@WarrenBelz 

 

Ok so i think we are both confused.

 

Gallery4_2 is the first gallery with all of the information.  This is associated to a specific list of assets "Circuit Switcher"

Dorinda_0-1649109997804.png

The next gallery next to the big white space is Gallery5_2, this is the Filter piece i referenced earlier.  This should display a thumbnail and the name of the image.

Filter(
    AssetPhotos,
    Station = Gallery4_2.Selected.Station && AssetClass = "Circuit Switcher" && 'Asset Location'= Gallery4_2.Selected.'Asset Position'
)

 

The big white space is where the image should be showing.

LookUp(
   AssetPhotos,
   ID = Gallery4_2.Selected.ID
).'{Thumbnail}'.Large

@Dorinda ,

As per previous post, if inside the gallery

ThisItem.'{Thumbnail}'.Large

As I mentioned, forget about the Lookup - you are simply displaying an image which is part of the dataset in the gallery.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,686)