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
Community Champion
Community Champion

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.

View solution in original post

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
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,292)