User function
Applies to: Canvas apps Power Pages
Returns information about the current user.
Description
The User function returns a record of information about the current user:
Property | Description |
---|---|
User().Email | Email address of the current user. The User().Email function returns the user's UPN and not the SMTP email address. |
User().EntraObjectId | Microsoft Entra Object ID of the current user, useful for calling APIs that use this value. This is a GUID value and unique for each user. |
User().FullName | Full name of the current user, including first and last names. |
User().Image | Image of the current user. This will be an image URL of the form "blob:identifier". Set the Image property of the Image control to this value to display the image in the app. |
Note
The information 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.
Note
If you published your application with a User function prior to March 2020, you may find that it, intermittently, will not retrieve photos. The issues were fixed in the late March 2020 release. To take advantage of the updated implementation, simply re-open your application, save it, and republish it.
Syntax
User()
Examples
The current Power Apps user has the following information:
- Full Name: "John Doe"
- Email address: "john.doe@contoso.com"
- Entra Object Id: aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb (GUID)
- Image:
Formula | Description | Result |
---|---|---|
User() | Record of all information for the current Power Apps user. | { FullName: "John Doe", Email: "john.doe@contoso.com", Image: "blob:1234...5678", EntraObjectId: a90c6800āe58cā4495ā81f7ā55819b56fe2a } |
User().Email | The email address of the current Power Apps user. | "john.doe@contoso.com" |
User().FullName | The full name of the current Power Apps user. | "John Doe" |
User().EntraObjectId | Microsoft Entra Object ID of the current user. | aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb (GUID) |
User().Image | The image URL for the current Power Apps user. Set the Image property of the Image control to this value to display the image in the app. | "blob:1234...5678" With ImageControl.Image: |