Hi @CurtisH42 ! LookUp returns only the first record that satisfies a condition and therefore not useful if you want to source multiple databases & records. Here's a conceptual approach to how you might start restructuring your collection logic:
Clear(colCombinedData);
ForAll(Training_Matrix_People_Departments As _Person,
Collect(colCombinedData,
AddColumns({_Person},
"TrainingTopics",
Filter(Training_Matrix_Topic_by_Dept, Title = _Person.Function),
"TrainingExpiryDates",
Filter(Training_Matrix_Training_Dates, Title = _Person.Title)
)
)
);
This approach assumes that you can modify the structure to include collections of topics and expiry dates within each record for a person. You'll need to adjust the logic based on the actual structure of your SharePoint lists and the specific requirements of how you wish to display the data.
Display in Gallery: Once you have a collection that correctly represents the data structure you need (with potentially nested collections for training topics and expiry dates), you can use a gallery (or nested galleries) to display this information. Ensure that your gallery's Items property is set to the collection (colCombinedData) and adjust the internal controls to display the nested information as required.
This approach is quite high-level and needs adjustment based on your specific data structure. The key is moving away from LookUp for single records to a method that correctly aggregates all necessary records into your collection for display in the gallery.
Have fun! 😉
------------------------------------------------------------------------------------------------------------------------------
If I have answered your question / helped to solve your problem, please accept as solution and give me a Thumbs up. Thanks! - Remember: you can accept more than one post as a solution.