web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / 'Lookup' formula to di...
Power Apps
Answered

'Lookup' formula to display image from Sharepoint Library

(0) ShareShare
ReportReport
Posted on by 116

My question is a variation on this one, but it's different enough that I didn't want to tack on to it. I think the answer should be very similar though:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Get-image-from-Sharepoint-list-or-library-and-show-the-picture/td-p/471561

It's an order app. The user enters various pieces of information, and when it's submitted it's written to a list. In one section, however, there's peninput for a signature, with the image being written to a library. That all works.

However, in the app when you go back into an existing order, how do I display the corresponding signature using an Image control?

I take it from the above thread that 'Lookup' is used, so I created the Thumbnail field in the library as mentioned. And, of course, I know the name of the library. But the 'condition' part of it is a mystery to me, since you're not actually "selecting" anything in this context (unlike the above thread). So, I'm not sure what the line should be.

LookUp(
 ImgLibrary,
 condition...?,
 'Thumbnail ({Thumbnail})'.Large
)

 

Categories:
I have the same question (0)
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    I would assume that there must be some metadata that associates the image file to a list item. Once you find that out then you can use those fields in the conditional part of the Lookup().

  • rseiler Profile Picture
    116 on at
    Yes, each image in the library is associated with a number in a certain field (let's call it FImage) in the list (let's call it List).

    The formatting of the conditional part continues to elude me, but you don't mean that the source (the first line) of LookUp() should actually be directed to List, right? I thought I at least had that part right.
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    The first part of the Lookup would be the Image library and the conditional part would be the selected image id value from the list compared to the Image Id column in the Image library.

     

    Lookup([ImageLibrary], [selectedListItemImageId] = [ImageIDFromImageLibrary])

  • rseiler Profile Picture
    116 on at

    OK, so using this as the line in question:

    'Sig Image'=ID,

    Would seemingly be correct ("Sig Image" is the field name used for this in the list, and "ID" is the corresponding field name in the library), but it yields an invalid argument type flag.

    Update: And now I wonder if I'm going about this all wrong. I've been acting upon the properties of an inserted Image, not the properties of the Image control within a Gallery. Is a Gallery required? There's only one signature per order, so the need for a gallery isn't there.

  • Verified answer
    rseiler Profile Picture
    116 on at

    The linchpin here is the "metadata that associates the image file to a list item," since I have no idea how to get at that.

    LookUp() works if it's canned, at least. For example, if I lookup the ID # (e.g. 100) myself for an existing order and apply this to the image control:

     

    LookUp( ImageLib, ID = 100, 'Thumbnail ({Thumbnail})'.Large )

     

    But getting the "selected image id value from the list compared to the Image Id column in the Image library" is a challenge. To start with, I see no indication that LookUp() works with multiple data sources at once.

    Update: Modified this way it works:

    LookUp( ImageLib, ID = Value(DataCardValue1.Text), 'Thumbnail ({Thumbnail})'.Large )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard