cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
powerkatz
New Member

Displaying attached images from SharePoint list in a gallery using a variable

Hello,

 

I'd like to thank you in advance for your assistance. It is greatly appreciated.

 

I have a SharePoint list where one of the columns is "Attachments".

In the Home Screen of the app I have a Galley with this SharePoint list as its data source.

The Image control inside this gallery has the following code: First(ThisItem.Attachments).Value.

I am doing it this way so in case there are multiple images, it just displays the first attachment image.

The OnSelect code for the Place a Bid  button is: Set(varItem, ThisItem); Navigate('Bid Screen') - this creates the varItem variable and places the selected item's information inside it, and then directs the user to the Bid Screen.

homescreen2.jpg

 

In the Bid Screen I'd like to display the information from varItem in a gallery and it actually works, besides the picture(s). The Items code of the Bid Screen's Gallery is varItem. When using this code it does bring in  the text from varItem. The problem I have is when trying to bring in the images into the Image controls inside the gallery. I even tried to bring in just one image, the same way i did in the Home Screen's Gallery. It doesn't work  as the code First(ThisItem.Attachments).Value no longer works in the Bid Screen's Gallery. Instead of "Attachments" I only have the option "Has Attachments" (see screenshots). I also tried using a nested Gallery inside of this gallery but ran into the same problem.

bidscreen1.jpg

 

bidscreen2.jpg

 

I am new to all of this, and i can't seem to figure this out.

How can I display all of the attachments of an item in my SharePoint list inside of the Gallery?

 

Thank you so very much for your assistance.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @powerkatz ,

 

You can also try other way around. 

 

In second Screen items : Filter(DataSourceName,ID=varItem.ID)  or Filter(DataSourceName,ID=YourGallery.Selected.ID)


Try In the Image: First(ThisItem.Attachments).Value

 

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

4 REPLIES 4
rampprakash
Super User
Super User

Hello @powerkatz,

 

Instead of using  Set(varItem, ThisItem);    you can try using HomePageGalleryName.Selected in the BidScreen.

 

For image you can Use

 

First(HomePageGalleryName.Attachments).Value

 

For populating image

 

If not if you want to Use  Set(varItem, ThisItem);  this Global Variable, Make Sure ONSELECT of image or any any fields in the Home Page Gallery and then Navigate Option.

 

Please Mark as Answer if it's helpful

 

Subscribe : https://youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA

Blog : https://microsoftcrmtechie.blogspot.com

 

 

 

PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @powerkatz ,

 

You can also try other way around. 

 

In second Screen items : Filter(DataSourceName,ID=varItem.ID)  or Filter(DataSourceName,ID=YourGallery.Selected.ID)


Try In the Image: First(ThisItem.Attachments).Value

 

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hello,

I tried your suggestion, and i could bring in the first image into the gallery the same way i did in the Home Screen. But due to First(ThisItem.Attachments).Value, this only brings the first image to the one Image control.

 

My problem:

How do I bring the second image to the second image control of the gallery?

 

 

Hello rampprakash,

 

 

Thank you,

After playing around with it al little but, i got it to work.

 

Million Thanks.

 

Thanks to you too, PG_Worxz10

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,483)