web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Convert LookUp Field D...
Power Apps
Suggested Answer

Convert LookUp Field Data to Text for Comparison

(2) ShareShare
ReportReport
Posted on by 45
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.
 
 
 
My current code OnStart of the app is as follows:
// assigned the current user to a variable on the employee table
Set(
    varCurrentEmployeeTeam,
    LookUp(Employees, 'Full Name' = User().FullName).Team
);
 
This appears to work, however I need to be able to compare this in a later if statement when the user clicks a button to clock out. That code currently goes as follows:
 
// 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!
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,963 Moderator on at
    Hi,
     
    I am guessing that one of the Columns has the actual string in it (like Name or something else)
     
    I am pretty sure its Name btw 
     
    Either
     
    1. after the word Team in your Lookup put another . (period) and look for the TEXT column you want. and done.
    Set(
        varCurrentEmployeeTeam,
        LookUp(Employees, 'Full Name' = User().FullName).Team.Name
    );
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard