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

10 REPLIES 10
Pstork1
Dual Super User
Dual Super User

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. 

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

 

 

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

 

Thanks so much! This worked for me

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,626)