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 / Retrieving current use...
Power Apps
Answered

Retrieving current user's Information

(0) ShareShare
ReportReport
Posted on by 23

I'm new to Power App and I'm developing an app for our organization, primarily for store guys to be able to see their default values (Warehouse, Facility, Printer etc.) 
I created a SQL database and tables that has all the above information for all the employees. I connected the SQL to the power App and I'm able to see the tables in the App.

 

Question:

1.Which layout option should I pick because I'm going to show information for only logged in user (Microsoft logged in)?

2.How can i retrieve the data from SQL table only for logged in user?

Please advise.

 

Thanks,

Vishwa

Categories:
  • Gochix Profile Picture
    1,937 Moderator on at

    @Vishwak ,

    Is this application you develop a Portal? If not, you cannot access the app without an o365 login.

    If you do need to check if the user has been logged in, however, you can use:

    If(User().Email = "myemail@domain.com","do something","do nothing, user not logged in")


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

  • VishalJhaveri Profile Picture
    1,169 Moderator on at

    Help yourself with the below formulas:

     

     

    Name = User().FullName
    Email = User().Email
    Image = User().Image

     

    If my answer helps you, please mark it as solution.

     

  • VK-23090237-1 Profile Picture
    23 on at

    @Gochix thanks for your message. The users will have 365login.Example my windows login is vishwakathir@xxx.com

    so, I could get the first name and last name from 365 and show in the App. I need to use the same details to fetch some information from SQL table like the warehouse, store mapped to Vishwa (user). Am I making sense?

  • VK-23090237-1 Profile Picture
    23 on at

    @VishalJhaveri thanks Vishal, so I need to add a text box and apply this formula? Please guide

  • VishalJhaveri Profile Picture
    1,169 Moderator on at

    Yes, you need a LABEL control to achieve the same. @Vishwak 

     

    If my answer helps you, please mark it as solution.

  • Verified answer
    Gochix Profile Picture
    1,937 Moderator on at

    @Vishwak ,

    Got you, to display the username, place a Label box and in the Text property add the formula

    User().FullName

     

    If you wish to retrieve some data based on the user then you will probably use a Gallery control for this.

    Then add the following formula to the Gallery Items property

    Filter('YourSQLTable', Email = User().Email)

    It will only display the data if user email address is the same as in the "Email" column. 

    You can change it to "Name" column and use User().FullName instead of User().Email


    _____________________________________________________________________________________
    Please give a thumbs up if I resolved your issue! Please click Accept as Solution to close the topic!

  • Verified answer
    VishalJhaveri Profile Picture
    1,169 Moderator on at

    Can you mark my answer as solution? @Vishwak 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard