cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DanielRK
Super User
Super User

How to write a formula to look up user based on job title

Hi,

 

I have a formula to look up a person's email based on their job title:

 

LookUp(
            Office365Users.SearchUserV2({searchTerm: ""}).value,
            JobTitle = "CEO").Mail
);

 

How would you write this to get more information about the user like the User() function where you can append 

 

.Email

.FullName

.Department

 

As needed? My formula is too narrow. I want to get more attributes than just the email.

 

Thanks a lot for your help!

 

Regards,

 

Daniel

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @DanielRK,

Have you solved your problem?

Do you want to get info based on Job Title?

Could you please share a bit more about your need?

Actually, the User() function only support to get info about the current login user.

vqiaqimsft_0-1632280256276.png

If you want to get info like department, Mail based on the Job Title, I think you should use the Office365Users() function.

I think you should pull out all the Job Title using Office365Users() as below:

Distinct(Office365Users.SearchUserV2({searchTerm:""}).value.JobTitle,JobTitle)

vqiaqimsft_1-1632281471974.png

Then you could add a Label and set the Text property to display the needed info based on Job Title:

LookUp(Office365Users.SearchUserV2({searchTerm:""}).value,JobTitle=ComboBox35.Selected.Result).Mail

There is no much easier method as above to achieve this.

Best Regards,
Qi

View solution in original post

2 REPLIES 2
v-qiaqi-msft
Community Support
Community Support

Hi @DanielRK,

Have you solved your problem?

Do you want to get info based on Job Title?

Could you please share a bit more about your need?

Actually, the User() function only support to get info about the current login user.

vqiaqimsft_0-1632280256276.png

If you want to get info like department, Mail based on the Job Title, I think you should use the Office365Users() function.

I think you should pull out all the Job Title using Office365Users() as below:

Distinct(Office365Users.SearchUserV2({searchTerm:""}).value.JobTitle,JobTitle)

vqiaqimsft_1-1632281471974.png

Then you could add a Label and set the Text property to display the needed info based on Job Title:

LookUp(Office365Users.SearchUserV2({searchTerm:""}).value,JobTitle=ComboBox35.Selected.Result).Mail

There is no much easier method as above to achieve this.

Best Regards,
Qi

View solution in original post

Hi @v-qiaqi-msft ,

 

My apologies for only replying to you now.

 

Thank you this helps me tremendously.

 

Regards,

 

Daniel

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,324)