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 / Displaying document fo...
Power Apps
Unanswered

Displaying document folder that matches title of SharePoint list item

(0) ShareShare
ReportReport
Posted on by 1,599 Super User 2024 Season 1

Hi,

I am still fairly new to PowerApps and don't have a development background.

 

On my app below, I have a flow that creates a folder in a document library named exactly the same as the "Contract Ref" column.

 

I want to be able to browse this folder within a gallery when viewing the SharePoint item in my canvas app (this is the grey section on the right!)

 

Out of the box if I have the Items function set to "Contract Documents", this lists all folders however I only wish it to display the documents that are in the same folder named as the Contract Ref.

 

Can anyone help?

 

ContractUI.png

 

2020-06-15 17_00_14-Window.png

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @sudosaurus :

    Do you want to browse the files in the specified folder?

    Please try this code:

     

    Filter(
     'Contract Documents',/*your library*/
     'Folder path' = LookUp(
     'Contract Documents',
     Name = "XXXXX" /*Specify the name of the folder*/
     ).'Full Path' & "/" /*Get the specified path*/
    )

     

    1.JPG

    If you still have any question,pleas don't hesitate to let me know.

    Best Regards,

    Bof

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    Hi @v-bofeng-msft 

     

    I have a column called "Contract Ref" (based on the ID column) - when an item is created, a folder with the same reference is created in the "Contract Documents" document library. Therefore, when the canvas form opens, I wish for this folder to display the files contained in it.  It is a different set of files depending on the list item that is opened.

     

    filter.png

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @v-bofeng-msft any ideas?

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @sudosaurus :

    I don't understand what you mean, could you explain it in detail?

    In addition,maybe this link will help you a lot:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Gallery-for-admin-user-in-powerapp/m-p/588483#M184470 

    Best Regards,

    Bof

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    @v-bofeng-msft 

     

    • I create a list item which has a custom reference field set as: LWCM-2020-06-09-5
    • When the list item is created, there is a Power Automate workflow that creates a folder in a document library with the same name as the custom reference field
    • When I open the list item, I wish to display the contents of that folder in the powerapps form
    • Therefore each list item should display the file contents of the files in each folder that is named the same as the reference number in the list item.

    Does this make sense?

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @sudosaurus :

    Try this code:

    Filter(
        'Contract Documents',/*your library*/
        'Folder path' = LookUp(
            'Contract Documents',
            Name = ThisItem.'custom reference field name'
        ).'Full Path' & "/"  /*Get the specified path*/
    )

    Best Regards,

    Bof

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    Hi @v-bofeng-msft 

     

    I've tried both of the following as wasn't sure whether PowerApps would accept a folder name a percentage symbol?

     

    Nothing is displaying.

     

    'Contract Ref' is the name of the column in the list form where the folder name matches.

     

    I assume I add a new blank vertical column into the PowerApp, connect it to my Document Library data source and then change the code for 'Items'?

     

    Filter(
    'Contract Documents',/Contract%20Documents/
    'Folder path' = LookUp(
    'Contract Documents',
    Name = ThisItem.'Contract Ref'
    ).'Full Path' & "/" /*Get the specified path*/
    )

     

    Filter(
    'Contract Documents',/Contract Documents/
    'Folder path' = LookUp(
    'Contract Documents',
    Name = ThisItem.'Contract Ref'
    ).'Full Path' & "/" /*Get the specified path*/
    )

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    Hi Bof @v-bofeng-msft 

     

    any more thoughts on this?

  • CU22072135-7 Profile Picture
    on at

    The parts that start and end like /* your library */ are just comments, you can delete them or leave them there. In any case, remove the "Contract%20Documents" line in your expression, try...

     

    Filter(
        'Contract Documents',
        'Folder path' = LookUp(
            'Contract Documents',
            Name = TextInput_ContractRef.Text
        ).'Full Path' & "/"
    )

     

    (the Name= part needs to be a reference to the field in your screen that contains  the Contract Ref / name of the folder)

     

    For example, as per the guide earlier in this thread, this works for a SharePoint library named "Documents" which has a sub folder named "Automation" - adding the below expression to the 'Items' property of a Gallery displays all the files in the folder "Automation"...

     

    Filter(
        Documents,
        'Folder path' = LookUp(
            Documents,
            Name = "Automation"
        ).'Full Path' & "/"
    )

  • sudosaurus Profile Picture
    1,599 Super User 2024 Season 1 on at

    I've tried this yet the document library still does not display.

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
Vish WR Profile Picture

Vish WR 633

#2
11manish Profile Picture

11manish 588

#3
Valantis Profile Picture

Valantis 457

Last 30 days Overall leaderboard