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 : XPYzG2d4BOYUdz/2mOvuk1
Power Apps - Building Power Apps
Unanswered

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

Like (1) ShareShare
ReportReport
Posted on 4 Jun 2022 14:45:22 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

 

  • FranzRosa Profile Picture
    21 on 02 Aug 2024 at 06:38:18
    How to display attachments in power app gallery based on form selected item

    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




  • v-guarama Profile Picture
    18 on 29 Dec 2022 at 18:03:17
    Re: How to display attachments in power app gallery based on form selected item

    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

     

     

  • Bochie Profile Picture
    237 on 05 Jun 2022 at 03:34:31
    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

     

     

  • WarrenBelz Profile Picture
    149,223 Most Valuable Professional on 05 Jun 2022 at 02:12:53
    Re: How to display attachments in power app gallery based on form selected item

    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

     

  • nook36 Profile Picture
    21 on 05 Jun 2022 at 01:37:50
    Re: How to display attachments in power app gallery based on form selected item

    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
    149,223 Most Valuable Professional on 04 Jun 2022 at 22:11:54
    Re: How to display attachments in power app gallery based on form selected item

    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

  • Shujaath_Khan Profile Picture
    1,111 Super User 2024 Season 1 on 04 Jun 2022 at 16:25:46
    Re: How to display attachments in power app gallery based on form selected item

    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.

     

     

  • Bochie Profile Picture
    237 on 04 Jun 2022 at 15:26:47
    Re: How to display attachments in power app gallery based on form selected item

    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

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…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete