Our anization uses a DisplayName
that is different from FullName
for all things Microsoft.
Hence FullName
maybe something like "John Smith" while DisplayName
is "Smith, John (Accounting)"
I know I can display the FullName
of the current user in a PowerApp form (for SharePoint) by using User().FullName
Is there a way to similarly display the DisplayName
in a form? I know that PowerApps has access to the display names - they show up when I have a person picker combo box, for instance.
I found a workaround by adding a connection to Office365Users and using the following command Office365Users.MyProfileV2().displayName
. I would prefer to avoid this, though, as it sets off a connection permission dialog when a user first accesses the app.
Our anization uses a DisplayName
that is different from FullName
for all things Microsoft.
Hence FullName
maybe something like "John Smith" while DisplayName
is "Smith, John (Accounting)"
I know I can display the FullName
of the current user in a PowerApp form (for SharePoint) by using User().FullName
Is there a way to similarly display the DisplayName
in a form? I know that PowerApps has access to the display names - they show up when I have a person picker combo box, for instance.
I found a workaround by adding a connection to Office365Users and using the following command Office365Users.MyProfileV2().displayName
. I would prefer to avoid this, though, as it sets off a connection permission dialog when a user first accesses the app.
2 Answers
Reset to default 1There isn't a direct way other than what you have suggested already. But there is a workaround involving Power Automate flow. Follow the below steps:
- Create a flow with an instant trigger and set the trigger as
PowerApps V2
. - Set the parameter of the flow as a string in the trigger.
- Add the
Get User Profile step
(Office365User) and pass the user email id as the Principal user ID into the step. - Add
Respond to PowerApps
step and return the DisplayName of the user. - Go to the flow setting/description page and set the run-as-user property to a connection reference instead of the Run-as-provided user. (Typically a service account is preferred)
- Go to the
OnStart
property of your app call the flow pass the currently logged-in user email to the parameter and store the response in a variable.
Then you can use that variable wherever you want to display. Since you have configured run as a property of the flow to specific connection reference, hence user won't see any connection reference pop-up related to Office365Users.
try to Pull from a SharePoint people field, like the "Created By" or a custom person field.?