显示 PowerApps 用户的相关信息Show information about a PowerApps user

User 函数可显示与已登录用户关联的全名、电子邮件地址和图片。The User function can show the full name, the email address, and the picture that's associated with the user who's signed in. 可以使用此信息来自动填充窗体。You can use this information to automatically fill in a form.

例如,可以使用此功能:For example, you can use this feature to:

  • 为参加培训的用户、活动志愿者、展台签到等创建签到“表”。Create a sign-up "sheet" for users to attend training, volunteer for events, check in at a kiosk, and more.
  • 在人力资源应用中显示全名。Display the full name on a Human Resources app.
  • 联系支持人员时,自动输入电子邮件地址。Automatically enter an email address when contacting your helpdesk.

基本上可在自动填充窗体或标签的任意情景中使用此功能,用户会因此而获益Basically, you can use this anywhere users would benefit from a form or labels that are populated automatically

 

必备组件Prerequisites

显示用户详细信息Show user details

  1. 在“插入”选项卡上,单击或点击“媒体”,然后单击或点击“图像”。On the Insert tab, click or tap Media, and then click or tap Image.

  2. Image 属性设为下面的公式:Set the Image property to this formula:
    User().ImageUser().Image

  3. 在“插入”选项卡上,依次单击或点击“文本”和“标签”:On the Insert tab, click or tap Text, and then click or tap Label:

  4. Text 属性设为下面的公式:Set the Text property to this formula:
    User().FullNameUser().FullName

    执行此操作时,标签会自动填充为全名。When you do this, the label is automatically populated with your full name. 移动标签,使其位于图像控件下方,如下所示:Move the label so it's below the image control, similar to the following:

  5. 添加另一个标签,然后将其 Text 属性设置为以下公式:Add another label, and set its Text property to this formula:
    User().EmailUser().Email

    执行此操作时,标签会自动填充为电子邮件地址。When you do this, the label is automatically populated with your email address. 移动标签,使其位于第一个标签下方,如下所示:Move the label so it's below the first label, similar to the following: