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 / User().FullName versus...
Power Apps
Answered

User().FullName versus Office365Users.MyProfile().GivenName & " " & Office365Users.MyProfile().Surname

(0) ShareShare
ReportReport
Posted on by 99

Hi There - I'm hoping someone can provide some guidance.

 

I launched an app in mid-May that has a timesheet functionality that allows users to log time against tasks on projects. The timesheet captures the logged in user behind the scenes using User().FullName and writes that to the EmpName field (which is single line of text field) in my SharePoint list. 

 

Initially everything worked fine, but recently users have been reporting that their time is not saving properly. I have been tearing my hair out trying to figure out what's happening. This morning I finally discovered that sometimes User().FullName is returning FirstName LastName and sometimes it is returning LastName, FirstName. 

 

So when users return to their timesheet to add more hours, some hours aren't showing. The timesheet is just a Gallery of items with a filter that says show me the entries for the selected timesheet week where EmpName=User().FullName. So depending on how PowerApps decides to recognize the user at that exact point in time (i.e, at that moment are they seen as FirstName LastName or LastName, FirstName), there are missing records when the data was stored the opposite way.

 

I am not finding any patterns as to why, how or when this is happening. It is not happening to all users and not happening to any particular user and for those it has happened to, it is not even consistent. They can enter hours as FirstName LastName and then return an hour later and this time is saves their name as LastName, FirstName.

 

I've searched the community and I can see that others have encountered the same issue. I found a suggestion to use Office365Users.MyProfile().GivenName & " " & Office365Users.MyProfile().Surname instead of User().FullName. This would require a significant level of effort to update my app at this point and I'm not certain this will even solve the issue.

 

I was hoping someone might be able to provide some insight and guidance on the best approach to make this work consistently and reliably every time. Any help or insight is greatly appreciated...thank you, in advance!

Categories:
  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    We had a similar situation when we were trying to use User().Fullname which gets the name associated with powerapps account which not reliable. And we changed to use Office365Users.MyProfile().UserPrincipalName as unique id and Office365Users.MyProfile().GivenName & surname to display. We never had any issue with this.

  • tsparkman Profile Picture
    99 on at

    Hi @StalinPonnusamy - thank you so much for your reply...good to know that this solved the problem for someone else before I head down this road!

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard