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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to display attachm...
Power Apps
Unanswered

How to display attachments in power app gallery based on form selected item

(1) ShareShare
ReportReport
Posted on by 21

Hi,

I have a power app form that allows user to enter information and multiple attachments. The entered information is saved to a sharepoint list. I have added a gallery beside the form to display the attachments when the SP item is selected. However I've not being able to display the attachments in gallery. How do i do it?

nook36_0-1654353731072.png

 

Categories:
I have the same question (0)
  • Bochie Profile Picture
    237 on at

    Since you will have multiple attachments, you'll need to add a gallery inside your gallery (nested gallery). The sub-gallery Items property will be "ThisItem.Attachments". Then you can add an image control to the sub-gallery, with the Image property set to "ThisItem.Value". Just note, an excel attachment won't appear in the image. If you want all your attachments to appear regardless of file type, it would be better to store your attachments in a document library rather than a list. The doc lib in SharePoint has a column "Thumbnail" which will show a thumbnail preview of most if not all file types. Hope this helps! 
    -bochie

  • Shujaath_Khan Profile Picture
    1,111 Super User 2024 Season 1 on at

    Hi @nook36 

    Here is the sample for ref.

     

    GalAttachments would be sub-gallery in Parent Gallery template

     

    GalAttachments.Items = ThisItem.Attachments
    
    AttachmentName.HtmlText = $"<font color=blue>{ThisItem.DisplayName}</font></a>"

     

    ThisItem.'Has attachments' shall give bool flag if attachments are available so you could hide and seek sub-gallery

     

     

    shujaathkhan_0-1654359827301.png

     

    Thanks

    Please click Accept as solution if my post helped you solve your issue. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    HI @nook36 ,

    I have a blog on SharePoint images - this section will covers viewing them. Please follow the advice of  @Shujaath_Khan and @Bochie on the sub-gallery Items - all Image property viewing options are in the blog.

     

    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

  • nook36 Profile Picture
    21 on at

    Thanks @Bochie @Shujaath_Khan @WarrenBelz for the response. Is it possible not to use a sub-gallery? I was hoping that the gallery will show the attachments based on the selected item in SP. The control form will be filled with the selected item information but unfortunately the attachment showed no attachments. Hence i wanted to use galley to display the attachments of the selected item.

    nook36_0-1654392945791.png

    I tried @Shujaath_Khan 's suggestion but guess it does not meet the application i'm looking at.

    nook36_1-1654393000940.png

     

  • WarrenBelz Profile Picture
    153,079 Most Valuable Professional on at

    Hi @nook36 ,

    You can have a separate gallery with the Items, however the code supplied may not be entirely clear to you. For a Sub Gallery the Items are 

    ThisItem.Attachments

    For a separate gallery (substitute your gallery name here)

    YourGalleryName.Selected.Attachments

    The Image property options are as per my blog

    I am however a little confused as to why the attachment control is not showing them also (file names).

     

    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

     

  • Bochie Profile Picture
    237 on at

    @nook36 , one hack you can do if you do not want to use a nested gallery is use the "attachments" control from a Form control. Add a form in your screen, add the attachment control and copy-paste (ctrl+C, ctrl+V) it in your gallery. You then set the Items property of the attachment control to "ThisItem.Attachments". Your attachments control will have 2 errors: the tooltip and border color properties since it refers to "Parent". You can simply remove the formulas for it since you won't be needing it. You can then delete your form. It worked on my end (see screenshot). If you do not want to see the paperclip and "Attach File" text, set the "MaxAttachments" property of the control to 1. Then the "MaxAttachmentsText" to blank.

    Bochie_2-1654399487905.png

    Bochie_3-1654399857978.png

     

    Remove the formulas for Border Color and Tooltip.

    Bochie_1-1654399272699.png

     

     

  • v-guarama Profile Picture
    18 on at

    Hey guys

    If someone is still with this problem, im using "First(ThisItem.Attachments).Value" and it is working fine for me.

    vguarama_1-1672336925179.png

     

     

  • FranzRosa Profile Picture
    21 on at

    Hi @Bochie ,

    Thank you for the helpful workaround! I managed to display the list of attached files in the gallery as you suggested. The attached files that I want to show are stored in a sharepoint list.

    However, I'm facing an issue when trying to download these attachments. The files are visible, but there doesn't seem to be an option to download them directly from the gallery. Or rather, the download process is triggered, but I don't actually receive any file.

    Could you please advise on how I can enable the download functionality for these attachments? Any additional steps or formulas I should apply?

    Thanks in advance for your assistance!

    Best regards


    >

    Re: How to display attachments in power app gallery based on form selected item

    @nook36 , one hack you can do if you do not want to use a nested gallery is use the "attachments" control from a Form control. Add a form in your screen, add the attachment control and copy-paste (ctrl+C, ctrl+V) it in your gallery. You then set the Items property of the attachment control to "ThisItem.Attachments". Your attachments control will have 2 errors: the tooltip and border color properties since it refers to "Parent". You can simply remove the formulas for it since you won't be needing it. You can then delete your form. It worked on my end (see screenshot). If you do not want to see the paperclip and "Attach File" text, set the "MaxAttachments" property of the control to 1. Then the "MaxAttachmentsText" to blank.

    Bochie_2-1654399487905.png

    Bochie_3-1654399857978.png


    Remove the formulas for Border Color and Tooltip.

    Bochie_1-1654399272699.png




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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard