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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Populate Gallery Label...
Power Apps
Answered

Populate Gallery Label and Image Control

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

I have Gallery1.

Gallery1 is returning content from SPLibrary based on the 'Invoice Number'
in a Dropdown outside of Gallery1.

I am not able to get the 'Name' and the 'Thumbnail' content to populate.

Galley1 formula -

Filter(Activity_Documents_Collection,
'Name' in Activity_Invoice_Number_Dropdown.Selected.Value)

Gallery1, Document Name Field formula -
ThisItem.'File name with extension'

Gallery1, Image control formula -
ThisItem.Thumbnail.Large

Phineas_0-1709598460710.png

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,889 Most Valuable Professional on at

    @Phineas ,

    Assuming Activity_Documents_Collection is your Library and your filter is returning records, the Image could be

    ThisItem.'{Thumbnail}'.Large

     However there are two additional possible issues here - not all file types will resolve a thumbnail and also neither Name nor the in filter are Delegable, so it is possible in a large Library that you will not find the desired record.

  • Phineas Profile Picture
    5,331 Moderator on at

    Yes, I understand the delegation issue. I'll switch to the collection once I figure this out.

    I placed the following in the 'items' of the image control. Still no image. The document is a picture (.jpg).
         ThisItem.'{Thumbnail}'.Large


    Also, there is a '4' in the document name field.

    Doesn't that indicate data is being returned, just not the correct data?

    Attachment Submit Button Formula -

    UploadActivityDocumentFlow.Run(Label5_9.Text, Label5_2.Text &" - "& Label5_5.Text,
    {
        file:
        {
            contentBytes: First(Activity_Attachments_Control_DataCardValue.Attachments).Value,
            name: Activity_Invoice_Number_Dropdown.Selected.Value &" - "& Label5_2.Text &" - "& Activity_Document_Type_Dropdown.Selected.Value &" - "& Label5_5.Text  &"."&
            Last(
                    Split(
                        First(Activity_Attachments_Control_DataCardValue.Attachments).Name,
                    "."
                    )
            ).Value
        }
                       
    });

    My formula is creating three levels of folders, with the First, Last, Split.

    I only want one Folder (named by the formula), with the file inside.

    How do I update my submit formula to correct how the folder/file are being created?

    SP Library -
    Phineas_0-1709599939330.pngPhineas_1-1709600218494.png

     

  • WarrenBelz Profile Picture
    154,889 Most Valuable Professional on at

    @Phineas ,

    To answer the question you posted regarding displaying the file name and thumbnail, you appear to be filtering a collection Activity_Documents_Collection, rather than the 'Shared Documents' Library, so have you looked in the collection to see if the file is present. I can assure you that if it is then

    ThisItem.'{Thumbnail}'.Large

    will display the image and 

    ThisItem.'File name with extension'

    will display the file name.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Phineas Profile Picture
    5,331 Moderator on at

    I know your rules.

     

    In this case the extra context is important, as I believe the multiple layers of folder may be having an impact and wanted to get your thoughts.

     

    Yes, the document name and thumbnail appear in tables in the collection and not just as data.

  • WarrenBelz Profile Picture
    154,889 Most Valuable Professional on at

    @Phineas ,

    It is more the forum protocol when users are looking for your subject Populate Gallery Label and Image Control, however most responders greatly prefer (and it is a good courtesy) to see the entire issue in the initial post, so they know what they are dealing with.

    If you simply collect directly from the Library, folders are not relevant to the field 'File name with extension' and any search is directly on this or on the Name field, which is the same without the extension. An additional field FullPath contains the full folder patch and can be searched separately if necessary. Does your Collection fields follow what I have mentioned above ?

  • Phineas Profile Picture
    5,331 Moderator on at

    Not sure if this helps; here is the collection.

    Phineas_0-1709608857692.png

    Phineas_1-1709608902632.png

     

  • WarrenBelz Profile Picture
    154,889 Most Valuable Professional on at

    @Phineas ,

    What is your collection code ?

  • Phineas Profile Picture
    5,331 Moderator on at

    The OnStart is - 

         - ClearCollect(Activity_Documents_Collection,Documents_1)

    The Gallery is - 
         - 
    Filter(Activity_Documents_Collection,
           Name in Activity_Invoice_Number_Dropdown.Selected.Value)
  • Verified answer
    WarrenBelz Profile Picture
    154,889 Most Valuable Professional on at

    @Phineas ,

    The problem with that is you are also picking up the folders - if you do this (which is unfortunately not Delegable)

    ClearCollect(
     Activity_Documents_Collection,
     Filter(
     Documents_1,
     !IsFolder
     )
    )
    

    you will remove these, however a better plan is not have your search string in the folder name path as it appears you are picking up a folder record (4) which naturally is not a file and does not have a thumbnail.

    An even better plan is to have a text field in your Library with the file name and search on that.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard