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 Apps
Answered

LookUp in set

(0) ShareShare
ReportReport
Posted on by 17

Hello , i am working on an app. When the user logs in I want to register an ID as a local variable. Here is my function : 

Set(varID ; LookUp(Employee;Username = nameInput.Text && Password = passInput.Text).ID)

However it always returns an error saying that types are not compatible.

Are there any solutions ?

Categories:
I have the same question (0)
  • michelle4 Profile Picture
    98 on at

    Hi Khaled, 

     

    What column types are your Username and Password, text, number?

  • Khaled2 Profile Picture
    17 on at

    Hello, both of them are text 

  • michelle4 Profile Picture
    98 on at

    the code looks good to me. Can you try with a new variable name? 

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • SpongYe Profile Picture
    5,909 Super User 2026 Season 1 on at

    Hi @Khaled2 

     

    Maybe you can try this:

    Set(
     varID ; 
     Text(LookUp(Employee;Username = nameInput.Text && Password = passInput.Text; ID))
    )


    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Khaled2 Profile Picture
    17 on at

    Actually this is my whole code is there an error ? (Everything works fine when i remove the Set) 

     

    LookUp(Employee;
    Username = nameInput.Text && Password = passInput.Text;
    Set(varID ; LookUp(Employee;Username = nameInput.Text && Password = passInput.Text).ID) ;;
    Navigate('home screen');;
    ResetForm(Form2);;
    )

  • Verified answer
    Khaled2 Profile Picture
    17 on at

    Actually i put the set out of the lookup and everything works now thanks guys!!

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

#2
11manish Profile Picture

11manish 210

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard