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 / Form populated automat...
Power Apps
Answered

Form populated automatically by Username

(0) ShareShare
ReportReport
Posted on by 96

Hi guys,

I am currently building something like Audit Tracker.

I would like AUDITED BY field to be populated automatically by name of the user who is currently logged in (without possibility of changing this manually). 

 

I tried User().FullName on default property but it didn't work.

All my users are in Azure AD so when I am using User().FullName on a simple label it works fine.

 

Screenshot 2022-01-27 150512.png

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    You need to use the Office365User connector.

    Add the connector and in the default instead of User().FullName write:

    Office365Users.SearchUser({searchTerm: User().FullName})

    I think that is it and I didn t write anything wrong.

     

    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!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • Mariollo Profile Picture
    96 on at

    I got an error Expected record value.

    The rule produces Table values.

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    To make sure you only receive 1 and onle 1, lets search by email:

     

    First(Office365Users.SearchUser({searchTerm: User().Email}))

     

    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!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • Mariollo Profile Picture
    96 on at

    I do not have an error now but the field is blank and I can't choose anything.

    Maybe it's worth to mention that my source is SharePoint list and this particular field is Person or Group column

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Same case here.

    It is working for me.

     

    Nogueira1306_0-1643296119718.png

     

  • Mariollo Profile Picture
    96 on at

    Ok, the problem is that I need to paste it in DefaultSelectedItem, not in Default.

    One more thing - is it possible to disable this field, so users can't change it?

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Yes. On Display Mode. Change it to Visible or Disabled

     

     

  • Mariollo Profile Picture
    96 on at

    Another problem 🙂

    When this DefaultSelectedItem is auto populated and I click save form it doesn't update Sharepoint list.

    It looks like it's only "preview" of user name. Any solution to this?

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    Okay...Try this:

    On App on start or OnVisible of the screen, anything. Set this var:

     

    Set(varUser, {

    DisplayName: Office365Users.UserProfile(User().Email).DisplayName;
    Claims: "i:0#.f|membership|" & Lower(User().Email);
    UserPrincipalName: UtilizadoresdoOffice365.UserProfile(User().Email).UserPrincipalName

    }


    And, on DefaultSelectedItem write:

    varUser

     

    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!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • Mariollo Profile Picture
    96 on at

    @Nogueira1306 thank you for you answer, but is there everything correct with the formula in setting the variable?

    It doesn't create one.

     

    Screenshot 2022-01-28 111443.png

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

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard