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 / Mismatching User funct...
Power Apps
Answered

Mismatching User function and O365 - Source of User Function

(0) ShareShare
ReportReport
Posted on by 20

Hello there,

 

I got a simple authentication for my solution, where it checks a SharePoint list for access and role :

LookUp(__Settings, Username.DisplayName =User().FullName, Access)

 

 

This works perfectly fine for all but just 1 single user. The problem is that the

1-Username collection takes the DisplayName from O365 and it is "John Doe"

2-Powerapps takes the data with User() function from dynamics database, and it was "John Michael Doe"

 

This leads to fail on the check, and user can't access the app.

 

The question starts with this: the user name on dynamics is changed to "John Doe" 4 days ago (and it was told it may take 72 hours to update) but User() collection still has the middle name of the user on the app page. On power apps settings, I can actually see that is changed. The only place I can still see the "John Michael Doe" is the queue on dynamics, but I am not really sure if that is related or not.

 

So, do you know where exactly the User() function takes the values and how we may fix this?

 

Thanks in advance

  • Ben Thompson Profile Picture
    1,400 on at

    What does the user record in the D365 look like.

     

    Fullname is updated when the firstname and surname fields are updated (but sadly not in all circumstances). I suspect if you look at the user record the location of the issue may display itself. Then update the name record and see if that resolves it.

  • ResatCanerBas Profile Picture
    20 on at

    @ben-thompson I will try to check that with IT team. Since it involves HR and a different IT team, it takes a quite amount of time to make necessary changes. Let's see, and thanks. If I'll have a result, I'll mark this one as the answer.

     

    Thanks a lot!

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @ResatCanerBas ,

    Does this user has unique email address in your Office 365 Tenant and your Users Entity?

     

    In default, the Users Entity records in CDS would be synced from your Office 365 tenant. If the user has unique email address in your Office 365 Tenant and your Users Entity, you could retrieve the corresponding permission against the email address.

     

    Please try to modify your LookUp formula as below:

    LookUp(__Settings, Username.Email =User().Email, Access)

    then check if the issue is fixed.

     

    Actually, the User() function returned is for the current Power Apps user. It will match the "Account" information that is displayed in the Power Apps players and studio, which can be found outside of any authored apps. This may not match the current user's information in Office 365 or other services.

    Please check the following article for more details:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-user

     

    In addition, as another solution, I think the Office 365 Users connection could achieve your needs. Also please consider add the Office 365 Users connection into your app, then modify your formula as below:

    LookUp(
     __Settings, 
     Username.DisplayName = Office365Users.MyProfileV2().displayName, 
     Access
    )

     

    Please try above solution, then check if the issue is solved.

     

    Regards,

  • ResatCanerBas Profile Picture
    20 on at

    To be honest, we could not find to fix the user name on the User() collection. However, 

    Office365Users.MyProfileV2().displayName

    approach actually makes more sense and worked! Thanks a lot. 

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

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard