cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jean_9681
Helper II
Helper II

Auto-Populate fields based on other field value entered

Auto-Populate fields based on other field value entered - I have a field called Requestor (its a people group column)
and i am trying auto populate the Department based on the Requestor field value.

I tried this fx - Office365Users.UserProfile(DataCardValue12.Selected.DisplayName).Department
and it does not look good, i see a Red x next to Department. 

DataCardValue12 is from the Requestor field

PowerAPP.jpg

 

Help me with the correct fx/formula to get this working.

 

Thank you,

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Jean_9681 ,

Try

First(Office365Users.SearchUser({searchTerm:DataCardValue12.Selected.DisplayName})).Department

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

4 REPLIES 4
v-xiaochen-msft
Community Support
Community Support

Hi @Jean_9681 ,

 

The input parameter is wrong.

v-xiaochen-msft_0-1621493762539.png

User principal name= User Id ≠DisplayName

 

Please try this formula:

Office365Users.UserProfile(DataCardValue12.Selected.Email).Department

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

WarrenBelz
Super User
Super User

Hi @Jean_9681 ,

Try

First(Office365Users.SearchUser({searchTerm:DataCardValue12.Selected.DisplayName})).Department

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thank you so much for taking the time to help me, the formula you suggested did not work however it did remove the red x but the autofill did not work.

@WarrenBelz  Thank you  it worked as expected.
First(Office365Users.SearchUser({searchTerm:DataCardValue12.Selected.DisplayName})).Department

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,934)