cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
powerappstx
Level: Powered On

Data Table + SharePoint Relationship/lookup

Hi,

 

I have two tables: "Employees" which containsa list of all of our employees and "Training" which contains a list of all of the training classes that the employee needs to complete. Both tables also an "EmployeeID" column.

 

I am building a datatable to show the list of employees and then a column for each of the 15 classes that they have either taken or completed, which is identified with a yes/no.

 

Since these are two seperate tables, I need a way to lookup the EmployeeID from the Training table into the EmployeeID  within the Employee table. I have tried the below code but can't seem to get it working. Can anyone provide some guidance?

 

Note: on the Data Table I have added Training.EmployeeID, Training.Class1, Training.Class2, etc. On the Training.EmployeeID column I would like to rename this from EmployeeID to a lookup into the Employee table and RETURN the Employee.EmployeeName field.

 

LookUp(MAX_Employee_Training, ThisItem.EmployeeID = MAX_Config_Employees.EmployeeID, MAX_Config_Employees.EmployeeName)

 Expected outcome:

 

Employee.EmployeeName, Training.Class1, Training.Class2, Training.Class3, etc.

1 REPLY 1
Super User
Super User

Re: Data Table + SharePoint Relationship/lookup

Hi @powerappstx 

If you are not committed to using datatables, I was wondering if you would consider the GroupBy() function and a flexible height Gallery and Subgallery.  To do it you would 

ClearCollect(coltraining,GroupBy(Training,"EmployeeID", "RestofData"))

Then you would have an outer gallery with the Items property of coltraining.  In this gallery you would put a label with the Text property Lookup(Employee,EmployeeID =ThisItem.EmployeeID,EmployeeName)  Then put a gallery inside of the first one with the Items property RestofData.   In this subgallery you could have all of the training sessions attended by the employee in the outer gallery.  I did something similar with Customers and Orders.  It helps to set the fill property of the subgallery to a different color.Screenshot_3.png

 

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 327 members 4,461 guests
Please welcome our newest community members: