cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jeckard
Helper I
Helper I

Showing attachments from a Sharepoint List

This may seem like something simple but I can not get this to work.

I simply want to show the attachment in the gallery.  My data is coming from a Sharepoint list.

I want 

Name, Title and then the attachment which will be a PDF I don't need to show a "image" of the attachment...there are tons of tutorials on how to do that I just need to show the attachment.  There won't be any "detailed screens.  This is a simple find the person and get the information about the screen.  I am mainly wantiPowerApp.PNGng the search function of PowerApps here.

1 ACCEPTED SOLUTION

Accepted Solutions
RezaDorrani
Dual Super User II
Dual Super User II

Hi @jeckard 

 

Because attachments is a collection  (one can upload more than 1 attahments)

 

if you are sure that users wont upload more than 1 attachment per list item

 

then just add a button and use Launch(First(ThisItem.Attachments).AbsoluteUri)

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

View solution in original post

9 REPLIES 9
Pstork1
Dual Super User III
Dual Super User III

It looks like you are trying to display it in a textbox.  The problem is that attachments are a collection.  There may be no attachment, or one, or multiple attachments. I think you are trying to progam it like there would always only be one. If you wanted to show just the first filename in the attachments use this

First(ThisItem.Attachments).DisplayName

otherwise you'll need to add some kind of control that can show a collection of items.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

That worked however I can't click on it and get it to download the attachment. 

Pstork1
Dual Super User III
Dual Super User III

To click on it and download the attachment you'll need to use something other than a Textbox. Probably something like an HTML control, but I'm not sure how you would bind the value to a link in that control. 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
RezaDorrani
Dual Super User II
Dual Super User II

Hi @jeckard 

 

Add a gallery within this gallery and associated its Items property with ThisItem.Attachments

 

The within gallery use ThisItem.displayname and other properties to show data

To download add a button within this sub gallery and use Launch(ThisItem.AbsoluteUri)

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Reza

I am not understanding what you mean Add a gallery within this gallery and associated its Items property with ThisItem.Attachments.

 

Why can't I just do Launcht (ThisItem.Attachments.AbsoluteUri) from the button?

RezaDorrani
Dual Super User II
Dual Super User II

Hi @jeckard 

 

Because attachments is a collection  (one can upload more than 1 attahments)

 

if you are sure that users wont upload more than 1 attachment per list item

 

then just add a button and use Launch(First(ThisItem.Attachments).AbsoluteUri)

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

View solution in original post

Anonymous
Not applicable

Using only the First function the attachment is shown, only on my pc not on the phone. using LAUNCH does not show anything.

serescro
Regular Visitor

Small  workaround,   on the Thumbnail card,  add  a Label   example  URLattachment.Text = First(ThisItem.Attachments).AbsoluteUri,   then  add a  button   OnSelect =  Launch(URLattachment) , and that did the trick for me   ,  for  some reason I got stuck there too.   De nada 😄  saludos desde Regiolandia !

serescro_0-1628872699685.png

 

Kiki1
Frequent Visitor

Thanks so much! This worked for me

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,131)