顯示 PowerApps 使用者的相關資訊Show information about a PowerApps 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: