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.

View solution in original post

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (997)