web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : 1liYtPRrtP2vqlSbW/Blpc
Power Apps - Building Power Apps
Answered

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

Like (0) ShareShare
ReportReport
Posted on 12 Sep 2021 09:48:09 by 8

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.

 

 

I have the same question (0)
  • powerkatz Profile Picture
    8 on 12 Sep 2021 at 12:56:31
    Re: Displaying attached images from SharePoint list in a gallery using a variable

    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

  • powerkatz Profile Picture
    8 on 12 Sep 2021 at 12:50:34
    Re: Displaying attached images from SharePoint list in a gallery using a variable

    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?

     

     

  • Verified answer
    PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on 12 Sep 2021 at 10:40:12
    Re: Displaying attached images from SharePoint list in a gallery using a variable

    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.

  • Ram Prakash Profile Picture
    5,395 Super User 2025 Season 2 on 12 Sep 2021 at 09:54:50
    Re: Displaying attached images from SharePoint list in a gallery using a variable

    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

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 917 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 387 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 334 Super User 2025 Season 2

Last 30 days Overall leaderboard
Loading complete