In my app I have 2 SharePoint lists: Projects and Resources. Lets say for the sake of simplicity, this is what the structure of each looks like:
Projects:
Project ID (Number)
Project Name (Text)
Planned Start (Date)
Planned End (date)
and a bunch of other columns that aren't related to this issue
Resources:
Project ID (Number)
Resource (Person)
The Projects to Resources relationship is One to Many on the Project ID (you can have multiple resource records that have the same Project ID.
I'm trying to show a gallery that contains lines from the Projects list when a resource is selected from another gallery (basically trying to show all the projects that the selected Resources.Resource is involved with.
The information I'm trying to show is the Project #, Project Name, and Planned End from the Projects list.
The way I have it set up now is that Selecting the resource shows a new gallery where the Items property is set to:
Filter('Resources',Resource.DisplayName=galDashboardResources.Selected.Resource.DisplayName)
and in the template for that new gallery, I have 3 labels: Project ID, Project Name, and Planned End.
The Project ID is ThisItem.'Project ID', and the Name and Planned End are both LookUps:
LookUp(Projects,'Project ID'=ThisItem.'Project ID','Project Name')
LookUp(Projects,'Project ID'=ThisItem.'Project ID','Planned End')
So basically, for every record in this new gallery it's trying to show, it's having to do 2 lookups per record to get the name and planned end for the Project ID from the Resources list, which seems terribly inefficient. Right now there isn't a lot of data in the lists, but I'm worried that down the road, it's going to be extremely slow, especially if someone is on many projects.
Is there a more efficient way to do this? Maybe create a collection with just the Project ID, Name, and Planned End from the Projects list and use that as the Items of the project list gallery?