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 III
Super User III

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 III
Super User III

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,292)