cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
monatech
New Member

Filter one table by another table (i think!)

Hi Everyone,

 

I have spent all day trying to figure this out but keep hitting a brick wall. I hope that someone can help.

 

Essentially what I want to do is this.

 

Assign a course to a department

Assign a User to a department

Assign a User to a course

Display or highlight courses that user is assigned to when their name is selected

 

Normally, I would create these apps using SharePoint Lists, and I feel it would work using them, but I decided to explore the dataverse and have created all the necessary tables and applied the relationships to them.

 

So I have a screen like this

 

monatech_0-1617040636443.png

On the top left I have a department select, when selected it filters the Employee gallery on the left with the employees in that department - this is working fine

 

It also shows the all the courses available to that department in the next gallery, also working fine

 

Finally, I want to be able to Select a name on the left and highlight in the "Available Courses" gallery courses that they have already been assigned to.

 

The code I have been using and thought would work is this

 

If(ThisItem.Name in TrainingLinkTable.Training.Name,true,false)

 

but it all returns false, If I hard code the table in, instead of TrainingLinkTable.Training.Name it works.

 

The TrainingLinkTable in this case is a collection, but I have directly to the table as well and it does work.

 

It should also be noted that the TrainLinkTable is a link table in a many-many relationship between Courses table and Employees table

 

So a course can have many employees and an employee can do many courses.

 

Would really appreciate if someone could help guide me in where i am going wrong with this.

 

Thanks

 

Ronan

 

1 REPLY 1
Bilakanti
Responsive Resident
Responsive Resident

@monatech ,

 

You can use the below code on Template Fill property of the Available Courses gallery.

Bilakanti_0-1617074853918.png

 




I have created temporary collections to reproduce your issues. Below are those collections

ClearCollect( colDepartments, {DeptName: "I.T.Department"} ); ClearCollect( colDepartmentEmployees, { Name: "Karthik", Department: "I.T.Department" } ); ClearCollect( colAvailableCourses, { CDepartment: "I.T.Department", Name: "Karthik", CourseName:"PL-900" }, { CDepartment: "I.T.Department", Name: "Karthik", CourseName:"PL-100" }, { CDepartment: "I.T.Department", Name: "John", CourseName:"Essential Skillz:Evacuation Procedures" } )

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,712)