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

Display Images in PowerApps Gallery from Separate Sharepoint List Columns

Hi -

 

I have a sharepoint list that stores each image URL in separate columns. I would like to have a scrollable image gallery show each image from the separate columns in sharepoint list as the user scrolls through the product images.

 

I think a Lookup function that says If the current slide is equal to 1 then return Column Image1 URL, if the current slide is equal to 2 then return Column Image2 URL and so on. I'm unable to figure out the proper syntax for that. Is anyone familiar with how to accomplish this?

Gallery:

dihelp_0-1640584085474.png

dihelp_1-1640584108669.png

 

 

 

 

Thank you in advance for the help!

 

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @dihelp ,

I am assuming this is the same list? You would have to hard code it - you did not say which field contained the number, but it would be something like

Switch(
   ThisItem.YourNumberField,
   1,
   Image1,
   2,
   Image2,
   3,
   Image3,
   . . . . .
)

 

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

Hi @WarrenBelz  -

 

Thank you for your response. There isn't a field that the formula is referencing (I would not think) when a user slides through the image gallery I would like it to show the images from the corresponding sharepoint list column based on the slide #. If I use thisitem.Image1 in the image property it shows all of the images in column Image1 in the gallery which is showing different products which is not desired. I would like it to lookup the product ID then return image1 for the first slide, image2 for the second slide and so on.

 

dihelp_0-1640638025947.png

 

On slide 1 it would show the Image1 column image, on slide 2 it would show the Image2 column image and so on.

 

dihelp_1-1640638131384.png

 

 

 

Thank you for the help its appreciated.

@dihelp ,

Your Product ID is the reference - just use the formula with that reference (you will need to put it in quotes "" if it is Text).

 

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

dihelp
Frequent Visitor

I'd like to have it so the gallery shows all of the images for that specific product/SKU/ID Only. The switch function doesn't seem to be giving me the desired result. 

 

I managed to filter the Image1 column to only return images for the product that is being viewed. Now I just need to some how create a collection of column (Image1, Image2, Image3, and so on) to return a carousel of all the product images just for that one SKU. So it is concatenating Image 1, 2, 3, 4 for one Record at a time. 

 

I may not be explaining my question properly or be misunderstanding your answer. I appreciate the help thus far I'm a new user to powerapps.

 

dihelp_0-1640667366261.png

dihelp_1-1640667518072.png

Example of Record in sharepoint list. Notice how the image URLS are in separate columns. I would like all of these images to appear in one gallery only for the one record.

 

dihelp_2-1640667840061.png

 

 

 

@dihelp ,

Yes, we are going in circles a bit and you really have not answered many of the questions I have asked. I also cannot see Product ID in the list fields you posted - is this in the same list? The Switch function is no different to an If function chain - just a bit neater.

What I need to know is how you determine which image you want displayed on a particular record.  Your structure is also not ideal - you could have all the images in a SharePoint Library with a reference field and simply lookup the Library based on the matching field in the list.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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