Hi there! Currently creating an HR Employee Self Service portal Power App. The users are able to clock in and out as needed, however, this process needs to be different based on the team the user is on. I have a Many-to-one relationship between my Employee Table and my Team table, where the Employee table now has a lookup field to the Team. If the user is on say Team A, they need to have a modified clock out process.
// assigned the current user to a variable on the employee table
Set(
varCurrentEmployeeTeam,
LookUp(Employees, 'Full Name' = User().FullName).Team
);
// first check if the employee is part of the tech ops team
If(
varCurrentEmployeeTeam = "Technical Operations",
// if they ARE tech ops
// check if the list is empty, if so: allow clock out
If(
IsEmpty(varCaseList),
Set(varAllowClockOut, true),
// otherwise dont allow clock out
Set(varAllowClockOut, false)
) + Set(varNumCases, CountRows('Current Active Critical Cases'.AllItems)) + UpdateContext({varTechOpsClockOutPopup:true}),
UpdateContext({clockoutpopup:true})
);
The issue I am having resides in the first line of the if statement. Due to the variable I created that grabs the Employee's team being a record data type, there is not a way to compare it to a text data type. Ideally, I believe it would be best to convert this record data to a text type data but I have been unsuccessful in doing so. If there are any other plausible solutions/workarounds I am very open to hearing what you have to say.
Thank you in advance for giving my post a read and for the possible help that may come!