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.