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 / View SharePoint Librar...
Power Apps
Answered

View SharePoint Library in a Gallery using name of gallery items

(1) ShareShare
ReportReport
Posted on by 12
I'm trying to populate a gallery in powerapps with any documents in a SharePoint library depending on the Project and Task that have been selected.

I've set a variable for the main folder and that's working fine and if I want I can set an icon so that it keeps drilling down but that's not what I want. 
 
The folder structure goes; Projects Folder > Project Folder (multiple folders all with matching project name as in SharePoint List) > Task Folder (all matching with the tasks in the SharePoint list).
 
I have a task card that when selected a Pop up appears displaying all of the information for a task and within that I also want to display any documents that relate to that task.

If I hard code it, it works perfectly. I can hard code the variables and it works,  however when I try to add the folder name in using a variable based on the item selected it does not work i.e. Set(varTaskFolder, ThisItem.TaskName). Same thing for the Project Folder. 
 
So hard coding it's Filter('Projects Folder', 'Folder path' = varMainFolder (this works as I can hard code it: "Projects Folder/") & "Project 1/Task 1/". If however when I select the task in my task gallery and set a variable as above (Set(varTaskFolder, ThisItem.TaskName)) and use the varible I have for the Project and grab the project name for it (Set(varProjectFolder, varProjectItems.Title)), so it all looks like this:
 
Filter('Projects Folder', 'Folder path' = varMainFolder & varProjectFolder & "/" & varTaskFolder  & "/"), I get nothing. Even though varProjectFolder = Project 1 and varTaskFolder = Task 1. I've added them all into a text label and they give me the correct text. I've even copied that text into the formula and it works.
 
I've also tried adding the  & "/" into the variables and that does not work either.
 
Can anyone explain where I'm going wrong.
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,075 Most Valuable Professional on at
    Firstly, you are dealing with a non-Delegable query here, however assuming your Library file numbers are under your Data Row Limit, you should be able to see it. Also I assume you have all the / characters in the right place (particularly the first one), so if you put this in a Label
    varMainFolder & varProjectFolder & "/" & varTaskFolder  & "/"
    you would see the complete correct path ? As I noted above, it should work, however try this (as well as confirming the assumptions)
    With(
       {_Path: varMainFolder & varProjectFolder & "/" & varTaskFolder  & "/"},
       Filter(
          'Projects Folder', 
          'Folder path' = _Path
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • CU06090422-0 Profile Picture
    12 on at
    So it turns out I was doing it the right way all along. Just a little bit of PEBKAC. There was a slight spelling mistake in one of the folder names which meant it did not match the one of the titles in the app correctly. This is what happens when you are slightly vision impaired.

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard