Skip to main content

Notifications

Community site session details

Community site session details

Session Id : g8H1dZXqLOEXk1VbnA+7d2
Power Apps - Building Power Apps
Answered

Office365Users.MyProfileV2().givenName returns the name of another user

Like (0) ShareShare
ReportReport
Posted on 25 Nov 2022 15:48:37 by 48

Hi πŸ™‚

 

I have a Sharepoint form that I'm customizing with PowerApps.

This form retrieves the name of the user logged in from the Active Directory through the code

 

Office365Users.MyProfileV2().givenName

 

However, an anomaly occurs whereby when other users fill out the form, their email is registered correctly while the giveName is replaced with the name of another person (every time it's the name of the same guy).

 

This issue is perhaps more of a systemic type, but I'll try to ask you hoping to find someone with experience in this regard

  • Verified answer
    Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on 25 Nov 2022 at 16:14:26
    Re: Office365Users.MyProfileV2().givenName returns the name of another user

    Try this:

     

    First(Split(User().FullName, " ")) -> first name

     

    Last(Split(User().FullName, " ")) -> last name

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution βœ”οΈ!

    Best regards,

    GonΓ§alo Nogueira

    Check my LinkedIn!

    My website!

    My blog!

  • FedeCandotto Profile Picture
    48 on 25 Nov 2022 at 16:11:53
    Re: Office365Users.MyProfileV2().givenName returns the name of another user

    Thank you for your reply! πŸ™‚

     

    For greater clarity: The form I am customizing is used by a school to help its students when they have to enroll in courses.

     

    I was specifically asked to create two separate fields (one for the first name and one for the last name).

    These two fields are then shown in the form in View mode so when the students will open them, they will already find their name and surname filled in, and simply have to choose which course to enroll in using a combobox.

     

    So, I don't think User.FullName can be a solution. Maybe associate with First() and Split()

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on 25 Nov 2022 at 15:58:49
    Re: Office365Users.MyProfileV2().givenName returns the name of another user

    Hey!

    Why dont you use User().FullName ?

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution βœ”οΈ!

    Best regards,

    GonΓ§alo Nogueira

    Check my LinkedIn!

    My website!

    My blog!

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard