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

Get image from Sharepoint list or library, and show the picture base on a dropdown selection

Hi All,

 

My application is an asset usage application. I have created a sharepoint list containing the assets, and in the power app a dropdown having the "Items"= Itemlist.Title. (dropdown in the image)

 

What i would like to achieve is to have above the dropdown 1 picture element, which based on what i select in the dropdown, shows that item image. (golden square in the image)

I don't know which is the good approach for this:

 

1) store the images as attachment in the "itemslist"

2) store the images in a sharepoint Library, naming each picture as the Items in the Itemlist.

 

Can i achieve this with simply powerapp or should i use also Power automate?

 

Thank you in advance for the help!!!!

 

@WarrenBelz?? 🙂

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @OliverV ,

This one is quite straight forward. (use your names for the Blue bits).

Create a SharePoint Library ImgLibrary and file the pictures in.

Include in the fields of the Library two items

  • A field called Thumbnail formatted as Hyperlink or Picture > Picture
  • A text field containing the reference you will be selecting - I will call it Title as per your mail

In the app DropDown ddTitle, I will assume ddTitle.Value is the resulting reference.

So all you need is an Image Control with the Image property

LookUp(
    ImgLibrary,
    Title = ddTitle.Value,
    'Thumbnail ({Thumbnail})'.Large
)

The picture should change each time you select another item.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

@Anonymous ,

This is an old closed post, but to answer your question, Name is the name of the file you put in the Library. The reference you need is probably

LookUp(
   Documents,
   Part = DataCardValue27.Selected.Value
).'{Thumbnail}'.Large

This is all in the blog I referenced.

View solution in original post

17 REPLIES 17
WarrenBelz
Super User
Super User

Hi @OliverV ,

This one is quite straight forward. (use your names for the Blue bits).

Create a SharePoint Library ImgLibrary and file the pictures in.

Include in the fields of the Library two items

  • A field called Thumbnail formatted as Hyperlink or Picture > Picture
  • A text field containing the reference you will be selecting - I will call it Title as per your mail

In the app DropDown ddTitle, I will assume ddTitle.Value is the resulting reference.

So all you need is an Image Control with the Image property

LookUp(
    ImgLibrary,
    Title = ddTitle.Value,
    'Thumbnail ({Thumbnail})'.Large
)

The picture should change each time you select another item.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

@WarrenBelzyou're awesome, if by chance u come around Budapest, u're my guest for a coffe/beer 😄

With library is 100% working.

only a last small question. This same solution is it possible with Sharepointlist attachments?

Hi @OliverV ,

Technically maybe, but a lot more effort and not something I have bothered with.

You live in a beautiful city - attached is a photo I took in July 2019. I live in Queensland Australia.

faisalrahman
Frequent Visitor

You can use simple First() function to retrieve image from your SharePoint list into a gallery In the Gallery bring an image control and write following code in the image control:

 

First(ThisItem.Attachments).Value

Senvanquy
New Member

Another solution : you can convert image to base64 type . At the sharepoint list column, you must set column is mullti line text and pate code  image base64 to there. Well done

Thank you! THIS was the code I needed to be able see the pictures from the image column in the sharepoint list in my powerapps gallery, thumbnails!

Hi @Eva1 ,

I have done a blog on various options of storing and viewing photos - it may be useful to you,

Thank you Sir !

It's working 😊👍

Anonymous
Not applicable

Hello Warren,

I'm facing kind of similar issue. I've uploaded the needed images to the documents to have an image library, except that I did not choose the column to be Image\Picture, it got named as "Name" by default. (Screenshot attached)

I want each choice in the dropdown list to have different image.

hantalabu_0-1629031633478.png

& used the following code:

Image= LookUp(Documents, Part = DataCardValue27.SelectedText.Value,Name)

 

Please support.

Many Thanks,

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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