cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
DavJaq
Level: Powered On

Populate department of selected person?

I have a customized SharePoint form with two fields, one for selecting a person (people picker field) and another field (text field) for that person's department. I would like the department field to auto populate with the person's department when the person is selected.

 

Tried with 

Office365Users.UserProfile(DataCardValue75.Text).Department

 (DataCardValue75 is the person selection field)

 

but it does not work... am I close or way off?

1 ACCEPTED SOLUTION

Accepted Solutions
seadude
Level 10

Re: Populate department of selected person?

Hi @DavJaq.

Try:

  • Ensure your Person-type field is a ComboBox in PowerApps
  • Ensure the Department field is a Text Box in PowerApps
  • Set Department Text Box Default Property to DataCardValue75.Selected.Department.

Good luck!

5 REPLIES 5
seadude
Level 10

Re: Populate department of selected person?

Hi @DavJaq.

Try:

  • Ensure your Person-type field is a ComboBox in PowerApps
  • Ensure the Department field is a Text Box in PowerApps
  • Set Department Text Box Default Property to DataCardValue75.Selected.Department.

Good luck!

DavJaq
Level: Powered On

Re: Populate department of selected person?

Thanks @seadude that worked...simpler than I thought, Happy New Year!

seadude
Level 10

Re: Populate department of selected person?

No sweat! Also note the other Active Directory objects you have access to after the "." (Department, JobTitle, etc.)

2019 cometh~!

Brice235i
Level 8

Re: Populate department of selected person?

Hi seadude, don't supposed you know how to get the person's manager?  the person nominated is not necessarily the current user.

seadude
Level 10

Re: Populate department of selected person?

Hi. Off the top of my head, it’s OfficeO365.ManagerV2({searchterm:User().DisplayName}) or something like that.
If you search the forum for “Get manager” you’ll find the exact syntax.
Good luck!