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?
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
>
@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.
Remove the formulas for Border Color and Tooltip.
Hey guys
If someone is still with this problem, im using "First(ThisItem.Attachments).Value" and it is working fine for me.
@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.
Remove the formulas for Border Color and Tooltip.
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
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.
I tried @Shujaath_Khan 's suggestion but guess it does not meet the application i'm looking 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
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
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.
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
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473