最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

sharepoint - PowerApps - Obtain DisplayName - Stack Overflow

programmeradmin2浏览0评论

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.

Share Improve this question edited Mar 27 at 23:40 Carlos N asked Mar 14 at 22:11 Carlos NCarlos N 2083 silver badges13 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

There 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:

  1. Create a flow with an instant trigger and set the trigger as PowerApps V2.
  2. Set the parameter of the flow as a string in the trigger.
  3. Add the Get User Profile step (Office365User) and pass the user email id as the Principal user ID into the step.
  4. Add Respond to PowerApps step and return the DisplayName of the user.
  5. 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)
  6. 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.?

发布评论

评论列表(0)

  1. 暂无评论