cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
warsongg00
Advocate II
Advocate II

How do you display attachment in gallery?

Capture.PNG

i have sharepoint list with attachment column , anyone know how do i make the attachment show up?

there is no option in layout 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Edwin-Abdalian
Impactful Individual
Impactful Individual

First let's start with this fact that you can have multiple files attached to one SharePoint record. because of this, you cannot bind the attachments to a single image control. Think about showing a table of attachments in one control, it's not possible. but certainly you can show the attachment(s) of a selected record, in a new gallery. Follow my example below:

1- Create one gallery for your SharePoint list, and create another gallery for your SharePointt attachments. align these two galleries side by side, or however you like to design your form.

2- Change the Item property of your second gallery to firstGalery.Selected.Attachments

attachements in gallery.PNG

------------------------------------------------------

Please Accept as Solution if this post answered your question so other members can find it. If you found this post helpful consider giving my post a Thumbs Up!

 

View solution in original post

v-siky-msft
Community Support
Community Support

Hi @warsongg00 ,

 

Which kind of attachment did you store?

How many attachments did you store in each item?

 

It can be known that the type of Attachments is table, because multiple attachments can be stored in it.

If you have multiple attachments in each item, @Edwin-Abdalian 's work around is good enough to display all attachments.

If you just want to display the first attachments or each item only have single attachment, you can modify the image property as below:

First(ThisItem.Attachments).AbsoluteUri

please refer to the following image.

Annotation 2019-10-14 115957.png

Best regards,

Sik

View solution in original post

6 REPLIES 6
Edwin-Abdalian
Impactful Individual
Impactful Individual

First let's start with this fact that you can have multiple files attached to one SharePoint record. because of this, you cannot bind the attachments to a single image control. Think about showing a table of attachments in one control, it's not possible. but certainly you can show the attachment(s) of a selected record, in a new gallery. Follow my example below:

1- Create one gallery for your SharePoint list, and create another gallery for your SharePointt attachments. align these two galleries side by side, or however you like to design your form.

2- Change the Item property of your second gallery to firstGalery.Selected.Attachments

attachements in gallery.PNG

------------------------------------------------------

Please Accept as Solution if this post answered your question so other members can find it. If you found this post helpful consider giving my post a Thumbs Up!

 

v-siky-msft
Community Support
Community Support

Hi @warsongg00 ,

 

Which kind of attachment did you store?

How many attachments did you store in each item?

 

It can be known that the type of Attachments is table, because multiple attachments can be stored in it.

If you have multiple attachments in each item, @Edwin-Abdalian 's work around is good enough to display all attachments.

If you just want to display the first attachments or each item only have single attachment, you can modify the image property as below:

First(ThisItem.Attachments).AbsoluteUri

please refer to the following image.

Annotation 2019-10-14 115957.png

Best regards,

Sik

Jreutbier
Frequent Visitor

@warsongg00, @v-siky-msft, @Edwin-Abdalian I have found that absoluteuri doesn't work on mobile and using .value loads very slowly. Did you have a similar experience?

Alberto_Coppola
Frequent Visitor

This line in the  Image property of the gallery worked fine for me:

 

First(ThisItem.Attachments).Value

 

(putting .AbsoluteUri instead of .Value makes images invisibile in the gallery when the app is displayed on a mobile)

Hi, Alberto

 

This code was working well until power apps version 3.22091.27 but not now.

The french version is Last(ThisItem.'{Attachments}').Value

If this code still working for you, can you tell me which version are you using in which country ? 

You can see it in Parameter menu then support (assistance in french)

LeVentriloque_0-1666358803962.png

Regards

Seb

Hi @LeVentriloque I'm currently using the 3.22102.32 versione web app

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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