cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bunly11
Helper V
Helper V

How do I display a photo for each supply in a record from Sharepoint?

Hi everyone -

 

I have a Sharepoint list for how to prepare a drug compound. 

Each drug has a list of supplies. Each drug may have up to 11 supply items. most of the items will be the same. 

I would like to display the image for each of the supplies.

 

Example

  • Syringe

Bunly11_0-1606113269614.jpeg

 

 

What would be the best way to do this in powerapps? or is this possible?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Bunly11 ,

Firstly, please get away from the double Thumbnail reference and type what I have posted. Secondly if the gallery Items are based on the table SuppliesTBL, you also have Supplies:ID.Value instead of simply SupplyID. So what you actually need should be

Lookup(
   ImgLibrary,
   DrugID=ThisItem.SupplyID
).'{Thumbnail}'.Large

Explaining this in logical steps, you have an image control in a gallery where the rest of the items belong to the list SuppliesTBL. You are then looking up ImgLibrary for a record where the field DrugID in the Library matches SupplyID in the List (hence you use the ThisItem reference as you are using a list field, not a control in the gallery) and then displaying the Thumbnail of the Library item.

I have done a blog on SharePoint image storage and retrieval. You may find some of it useful.

 

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

19 REPLIES 19
Anonymous
Not applicable

Hi @Bunly11 ,

 

If you are using a gallery to show the suppliers' information. Then use:

Image: ThisItem.InfoPic

You will be able to see the picture/photo of each supplier.

 

VSJadhav
Helper II
Helper II

In PowerApps portals its possible to handle with the help of JavaScript.
Fetch sharepoint records and use for-loop for it.
At each supplies you can create img tag and assign image.

v-siky-msft
Community Support
Community Support

 Hi @Bunly11 ,

 

Could you please share more details about your scenario? Did you store the image of supplies to Hyperlink/Picture or Attachment field?  How do you want to display the image in PowerApps?

Of course, you can implement your needs in PowerApps to display the supply images, but more information is needed to provide further assistance.

Sik

 

Hi @v-siky-msft 

 

I haven't created an image library yet because I wanted to see what the easiest way would be.

I would like the images to display on the mobile app and windows. 

I am using an attachment field already to display other images and attachments.

Is there another way to use a separate attachment field for just supplies? 

 

I had an Access database that I moved to Sharepoint. Each drug record may have up to 11 supplies (all in one table).

The supplies repeat for the most part so maybe 20 items in total but most records will have 3 to 5 supplies

Bunly11_0-1606148548913.png

 

 

 

I just do not know how to link the image to the list item. I do not have another list of just supplies. 

Do I need to make another table and then do a look up column?  or do I do something like this

https://powerusers.microsoft.com/t5/Building-Power-Apps/Get-image-from-Sharepoint-list-or-library-an... @WarrenBelz suggested 

@Bunly11 ,

Here is a blog I wrote on this subject - it may be helpful.

 

Hi @WarrenBelz Thank you for the blog- I have read it and used it before. I just am not sure how to apply it for this scenario.  My SharePoint list has up to 10 supplies for each record.

Bunly11_0-1606201796715.png

 

I am able to display the list of supplies in a blank gallery

Bunly11_1-1606201987243.png

I do not know how to combine and display all the items together in one gallery with a picture for each item.

I tried to added the items to a gallery with image.

Bunly11_3-1606202619234.png

I created an ImgLibrary similar to your other post I mentioned.

But I do not know how to link the picture to the list item. I tried the code below but was not successful. 

Bunly11_4-1606202708420.png

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

 

Thank you

Hi @Bunly11 ,

Firstly put as the Image of an Image control, the below code should show the first Library item matching the LookUp

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

If you put this as the Items of a gallery

Filter(
   ImgLibrary,
   Title = ddTitle.Value
)

and have an Image control in the gallery, the Image property of all matching images would be

ThisItem.'{Thumbnail}'.Large

This will display on mobile apps (we have done about 40,000 photos on iPads using the gallery method above).

 

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.

 

 

 

 

Hi @WarrenBelz 

 

I realized that I do not have a dropdown value like the other example. I have a list item from SharePoint. I put the item name as the title in the Sharepoint list and removed the "dd" but I get the below error. 

Bunly11_1-1606286392849.png

 

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

 

SharePoint properties

Bunly11_0-1606286042871.png

The Item in the gallery is ThisItem.DispSupply1

Thank you again for your responses.

Do you have any suggestions? This may be more complicated than I anticipated.

 

@Bunly11 ,

How are you referencing the item in the Library to match the List item it belongs to?

You need to have a matching reference in a Library field, otherwise how do you know what picture to show with what item?

As an example, I use the ID of the list item in a field in the Library I call IDRef. Your LookUp needs to reference the value in the List matching the reference in the Library.

 

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.

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (4,004)