cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
John_Martel
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
v-yutliu-msft
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
v-yutliu-msft
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

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors
Users online (2,051)