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 / Using LookUp to get Da...
Power Apps
Answered

Using LookUp to get Data Specific fiekd from mssql Table

(0) ShareShare
ReportReport
Posted on by 99

HI

I trying to add code to the App OnStart  to get a specific value base on loggedinUser  but can't seem to find the correct syntax

 

Set(varLoggedInUser,User());
Set(CurrentUser,User().Email);
Set(CurrentRole,LookUp('[dbo].[InquirersDetail_t]',Email=CurrentUser));

Suggestions?
 
MRRCOMP
Categories:
  • eka24 Profile Picture
    20,925 on at

    You need to add the specific ColumnName you want to hold in the variable:

    Set(varLoggedInUser,User());
    Set(CurrentUser,User().Email);
    Set(CurrentRole,LookUp('[dbo].[InquirersDetail_t]',Email=CurrentUser,SpecificColumn));
     
    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
  • Mrrcomp Profile Picture
    99 on at

    @eka24 

     

    Thanks for your quick response I tired your solution however

     

    1) CurrentUser is not an object but a single string (email) (i.e. I  can set a text box fx=CurrentUser and it displays the email of the logged in user)

     

     

    Regards

     

    MRRCOMP

  • eka24 Profile Picture
    20,925 on at

    Do you have an email collumn in your table. Also what ColumnName do you want displayed in the Lookup?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Mrrcomp Profile Picture
    99 on at

    @eka24 

    yes there is a Email filed and the field I want returned is Role

     

    Regards

     

    MRRCOMP

  • Verified answer
    eka24 Profile Picture
    20,925 on at
    Set(varLoggedInUser,User());
    Set(CurrentUser,User().Email);
    Set(CurrentRole,LookUp('[dbo].[InquirersDetail_t]',Email=CurrentUser,Role));
     
    I hope Role is also a column in your table.
    Try the above. If it doesn't work, take a screenshot of the form for any errors
    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
     
     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard