Good afternoon all,
In a Powerapps gallery image, how do I get the image thumbnail to show from the Documents library using my Sharepoint List?
This is the coding for the Image property in the gallery:
LookUp(Filter(Documents, "CPM Files/" in 'Folder path'),Filter( Documents, 'File name with extension' = Gallery1.Selected.ExternalFiles), 'Link to item')
When I click on the Gallery Image, a new browser window opens and only the file information is shown:
Background information: I have written the formula and flow to upload a file to the Documents folder (CPM Files) on Sharepoint and put data in the Sharepoint List (PreventiveMaintenance).
If the filename is the same but the data is different, the file does not get written, however the data does.
I don't want to duplicate and waste resources by uploading the same file to the Documents folder, so i use the Sharepoint List to hold the same filename as the document name in the folder for multiple entries.
Your help would be greatly appreciated,
Hi @Soundjam ,
Could you share more logical thoughts about filtering in your formula? Is there any error information shown in your formula? Is there two galleries? Gallery1 shows the SP List, Gallery2 show the Document folder? What is the data type of “ExternalFiles”? Choices or LookUp? Do you want to show Files in CPM Files in Gallery2, and show the images of files which is selected in gallery1?
First of all, the usage of lookup function in your formula is wrong, the second part of Lookup function should be Logical_Test, but what in your formula is Table type.
Then I assume that the “ExternalFiles” is Choices type. And you may can refer to this steps.
Filter(DOCS, "CPM Files" in 'Folder path')
If('File name with extension' = Gallery1.Selected.ExternalFiles.Value, ‘Link to item’)
If that doesn't meet your expectations, please share more details.
Thank you for taking the time to respond,
The logical thought about this (maybe it can't be done) is; I am using only one gallery to present the SP List for data AND return the thumbnail from the SP Documents (Docs) folder. When the Thumbnail of the image is clicked, it should open/download the document for viewing. I will have many items in the SP List that will utilize one file in the SP Docs.
The SP List (Preventive Maintenance) has a field: Title
The SP Docs (Documents/CPM Files) has a field: Name:
Both text in the fields from the List and Docs are the same.
So, my gallery Items is set to: showing the fileds from the SP List
Filter(PreventiveMaintenance, Barcode = galAssetPick.Selected.cBarcode)
The image property is set to: (i have changed it again) but still comes up with the same screenshot i posted previously)
LookUp(Filter(Documents, "CPM Files/" in 'Folder path'), Name = galShowFiles.Selected.Title), ThisItem.Thumbnail.Small
The last comma before ThisItem is showing an error: "Unexpected characters, characters are used in the formula in an unexpected way"
the OnSelect property for the image is set to:
Launch('Link to item')
Here is a image of what's going on.
1. File is selected and uploaded - information about the asset is written to the SP List along with the filename AND the File is uploaded to the SP Documents folder
2. Information from SP List is shown
3. Thumbnail i am trying to retrieve isn't working (thus my issue)
4. Not a part of the problem.
Sorry it took so long to reply back,
And, thank you again,
Anyone else want to take a shot at it?
What you are trying to do "should" be possible, however unfortunated I probably can help you much based on your current approach. There shouldn't really be any reason why you couldn't for example have 2 Gallery controls on your screen, one associated with the list and the other with Document Library (not visible). However I doubt that would "work" if your current approaches is not working.
I have however posted numerous blogs specifically pertaining to rendering thumnbail (and super HD) images within your apps and you may possibly find a blog there of use to. I have almost complete with my latest blog which depicts Gallery controls containing thumbnail images.
My latest blog however consumes content from SharePoint using a completely different approach to anything anyone else has extensively blogged on. I posted a demo video showcasing what type of mind-boggling functionality that people have been requesting for years. If you watch the video you'll see how well the thumnail images I have implemented in a Gallery control look,. Some awesome stuff.
Keep up to date with current events and community announcements in the Power Apps community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!