4 Various Ways to Get Selected User Manager Name By Default in Power Apps

While working with business applications, connecting employees with their managers for different tasks is important. In Power Apps, you can auto-populate the manager’s name when the employee’s name is entered.

In this article, I will explain four ways to get a user manager name in the Power Apps form.

Get Selected User Manager Name By Default in Power Apps

Getting the Manager’s name in the Power Apps application makes it easier for users and helps to keep the information correct.

Follow the four ways to auto-populate the manager name of the selected user in Power Apps.

1. How to Auto Populate Manager Name in PowerApps

Here, I have a Power Apps application, which stores the details of new employees. To avoid the selection of the wrong manager name.

I created one SharePoint list that stores only employee and manager details. Based on this data, I’m auto-populating the manager’s name while entering the employee’s name.

get manager name by default in powerapps

Here is the SharePoint list named Employee Information, which stores employees’ and managers’ names.

how-to auto populate manager name in powerapps
Column NameData Type
Employee NamesTitle(Single line of text)
ManagerNameChoice
I also have another New Employee Details list to store the employee details.
get the manager name in power apps
Column NameData Type
Employee NameTitle(Single line of text)
Manager NameChoice
Employee EmailSingle line of text
JobTitleSingle line of text

Now, follow the steps below to auto-populate the manager name based on the entered employee name.

1. Open Power Apps studio and create one blank canvas application. Connect with the two SharePoint lists.

Then, insert the Edit form into the screen -> In the DataSource property of the form, provide the SharePoint list name.

'New Employee Details'
get manager name and email in power apps

2. To get the manager’s name into this form, add a dropdown control instead of the manager name. Text input control. Then, provide the formula below in its Items property.

Choices([@'Employee Information'].ManagerName)
How to auto populate manager name in powerApps

3. Then, provide the formula below in the DefaultSelectedItems property of the manager name dropdown data card value.

LookUp('New Employee Details',Title=txt_EmployeeName.Text,ManagerName)

txt_EmployeeName is the input control name and ManagerName is the column name in SharePoint list New Employee Details.

power apps get user manager details

It will fetch the manager name of the user we entered in the text input control.

4. Make the DisplayMode property of the manager name data card value to disabled. So, end users can’t make any changes.

DisplayMode.Disabled
power apps get user manager name

Note:

Use the Patch() function to submit the details in the Power Apps form into the New Employee Details SharePoint list.
Patch('New Employee Details',Defaults('New Employee Details'),    {Title:EmployeeName_Value.Text,
'Manager Name':cmb_ManagerName.Selected.Value,
'Employee Email':EmployeeEmail_Value.Text,
JobTitle:jobTitle_Value.Text})

That’s it. Now, preview your app once. The manager’s name will auto-populate when you enter the employee’s name.

2. Get Selected User Manager Name in Power Apps

Here, we’ll see how to dynamically get the manager’s name while selecting the employee’s name. Both the employee name and manager name are Choice Fields.

Refer to the example below. When I select an employee’s name in the combo box control, that employee’s manager is populated.

powerapps office365users manager

Here, I have two SharePoint lists for storing project-assigned members and their manager names.

how to get manager name in powerapps

I have taken the employee name and manager name fields as a choice field, because of assigning tasks only for a particular team.

Column NameData taype
Employee NameChoice
Manager Name Choice
The second SharePoint is named “Project Task Tracking.” It stores the details of project tasks.
autopopulate manager name based on user in power apps

Here are the column names and the data type of the project task tracking list.

Column NameData type
Employee NameTitle(Single line of text)
Manager NameSingle line of text
Task NameSingle line of text
Task StatusChoice
Due DateDate field
Follow the steps below, to achieve the above example.

1. Create one blank application from the canvas app. Then, connect with the above two SharePoint lists.

powerapps manager name of user

2. Insert one Edit Form and provide the below SharePoint name in it’s DataSource property.

Datasource: 'Project Task Tracking'
powerapps get manager email

3. Click the form and delete the following data card values.

  • Employee Name – Data card value.
  • Manager Name – Data card value.

Then, insert the Combo box controls in place of deleted data card values.

4. In the Items property of the two combo box controls. Provide the following formulas.

Employee Name:

Choices([@'Employee and Manager details'].'EmployeeName (UserName)')

Manager Name:

Choices([@'Employee and Manager details'].ManagerName)

Save the changes and preview the app once; the employee and manager names will appear in the combo box controls, like in the example below.

power apps get managers manager
Note: Turn Off the Allow Multiple Selection for both combo box controls.

5. To get the manager name of the selected employee name, provide the formula below in the DefaultSelectedItems property of the manager name combo box control.

LookUp('Employee and Manager details', 'EmployeeName (UserName)'.Value = cmb_EmployeeName.Selected.Value, ManagerName)
get manager name of current user in power apps

6. Change the DisplayMode property of the manager name combo box control to Disabled so that end users can’t edit the manager name.

In this way, we can dynamically display the manager’s name while selecting the employee’s name.

3. Power Apps Get Current User Manager Name and Email

Here, I have a “Leave Request” form where I want to auto-populate the current user’s manager name and email.

power apps get current user manager email

Follow the steps below to achieve this.

1. Open the Power Apps form. Paste the formula below in the Default property of the manager name Text input control. It will get the current user’s manager name.

Office365Users.Manager(User().Email).DisplayName
powerapps get user manager email

2. Then, paste the below formula into the Default property of the manager email text input field. You will instantly get the manager’s email address in that field.

Office365Users.Manager(User().Email).UserPrincipalName
powerapps get current user manager name amd email

3. Then, set the DisplayMode property of the manager name and manager email Text Input controls to disabled mode.

DisplayMode: Disabled
power apps get manager of current user

4. Power Apps Office365Users Get Manager Name

I have an application here to update the daily work report. We added our employees and their managers to Office365.

Refer to the image below. Here, the manager’s name is auto-populating based on the employee name selection.

how to get current user manager in power apps

I have a SharePoint list named Daily Work Report, which stores the details entered in the Power Apps application.

power apps office365users get manager

Refer to the column names and the data types of the above SharePoint list.

Column NameData type
Employee NamePerson or Group
Manager NamePerson or Group
Date of ReportDate and time
Work statusChoice(Completed, Not Started, Pending)
Report summaryMultiline text
Follow the steps below to get the manager name of the selected employee.

1. In the Power Apps application, first connect with Office365Users and the SharePoint list.

powerapps office365users manager claims

As in the first two ways, create one edit form and add this SharePoint list as a Data Source.

2. Then, insert the formula below in the DefaultSelectedItems property of the manager name combo box control.

{
    '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     Department: Office365Users.ManagerV2(EmployeName.Selected.Email).department,
     Claims: "i:0#.f|membership|" & Office365Users.ManagerV2(EmployeName.Selected.Email).mail,
     DisplayName: Office365Users.ManagerV2(EmployeName.Selected.Email).displayName,
     Email: Office365Users.ManagerV2(EmployeName.Selected.Email).mail,
    JobTitle: Office365Users.ManagerV2(EmployeName.Selected.Email).jobTitle,
    Picture: ""
}
powerapps office365users get manager name

3. Make the DisplayMode of the manager name combo box control disabled. So users can’t change it.

DisplayMode: Disabled

Save the changes and then preview the app. Then, you’ll get the manager’s name of the selected employee.

Also, you may like some more articles:

I hope you understand getting a user’s manager name and email in

In this article, I have explained four scenarios for getting the manager’s name and email based on the user. You can take this article as a reference while trying to get a particular user’s manager name.

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…