cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

How to get an attachment from Sharepoint List item and display it in Image control

Hello,

 

My SharePoint List has attachments of "png" file type. I would like to be able to display the png attachment in the Image control on my app. I have started by looking up my item 

Set(MyItem, LookUp(MyList, ID=Value(ItemIDTextBox.Text)));

However the "Attachements" column is not visible in Intellisense. Not sure how to proceed. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @John_Martel ,

Do you want to display attachments in image control?

Since Attachments is a complex field, it is an embedded table actally, so you need a little complex formula.

I've made a similar test for your reference:

1)If your Attachments field only have one picture in one item, you could just use an image control to display.

You could try to set the image conrol's Image:

First(LookUp(list1,ID=1).Attachments).AbsoluteUri  //ID=1 is just an example, you could use other condition

Then, the image control will display the item's Attachments picture.925.PNG

 

2)If your Attachments field have many pictures in one item, I suggest you use a gallery to display the pictures of one record.

Firstly, add a gallery, insert an image control inside the gallery.

Set gallery's Items: 

LookUp(list1,ID=1).Attachments

Set the image control's Image:

AbsoluteUri

Then the gallery will display the item's Attachments picures.9251.PNG

 

9252.PNG

 

 

Best regards,

Community Support Team _ Phoebe Liu
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

2 REPLIES 2
Highlighted
Community Support
Community Support

Hi @John_Martel ,

Do you want to display attachments in image control?

Since Attachments is a complex field, it is an embedded table actally, so you need a little complex formula.

I've made a similar test for your reference:

1)If your Attachments field only have one picture in one item, you could just use an image control to display.

You could try to set the image conrol's Image:

First(LookUp(list1,ID=1).Attachments).AbsoluteUri  //ID=1 is just an example, you could use other condition

Then, the image control will display the item's Attachments picture.925.PNG

 

2)If your Attachments field have many pictures in one item, I suggest you use a gallery to display the pictures of one record.

Firstly, add a gallery, insert an image control inside the gallery.

Set gallery's Items: 

LookUp(list1,ID=1).Attachments

Set the image control's Image:

AbsoluteUri

Then the gallery will display the item's Attachments picures.9251.PNG

 

9252.PNG

 

 

Best regards,

Community Support Team _ Phoebe Liu
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

Highlighted

Hello everyone. In case you still have questions on the topic, we go through this in some more detail.

https://powerusers.microsoft.com/t5/Videos/Display-SharePoint-List-Attachments-in-PowerApps/td-p/413...

 

The .AbsoluteUri requires the user to be logged into the SharePoint front-end (which is not always the case obviously), while .Value uses the SharePoint connector to fetch the attachment(s) so this is a better option.

 

Dawid van Heerden

Follow on Twitter: @davestechtips

Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1

**If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions. AND we get points for it 😉

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,749)