web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Users Office 365 searc...
Power Automate
Unanswered

Users Office 365 searching users with email manager equals 'manager@microsoft.com'

(0) ShareShare
ReportReport
Posted on by 14

Hi, I need to search my company's Office 365 database for all employees whose manager has the email 'manager@microsoft.com'. And then I will research each employee's birthday. However, my company has many employees and therefore, I need to do this filter first to reduce the search and make the flow more efficient. Please, can anyone help?

 

Jonas_Cruzrj_0-1711137238666.png

 

Categories:
  • schmid1208 Profile Picture
    87 on at

    Hello @Jonas_Cruzrj,

     

    Thanks for your question! Try adding a Filter Array action, where you take the "value" dynamic content from your search then take the email and set it equal to your Manager@Microsoft.com. Then, use your apply to each to find their Birthday. By adding the filter array action, it'll eliminate the number entries the apply to each action has to go through. See the screenshot below for assistance!

     

    Screenshot 2024-03-22 at 6.19.26 PM.png

     

    I hope this helps, and hope you have a great rest of your day!

     

    Accept the solution if this helped and worked! 

     

    -Reid 

  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Hi @Jonas_Cruzrj 
    Login to Graph Explorer and try the following end point:

     

    https://graph.microsoft.com/v1.0/users/manager@microsoft.com/directReports?$top=999

     

     

    What do you get?

  • Jonas_Cruzrj Profile Picture
    14 on at

    In fact, I need to know the people whose manager has the email manager@microsoft.com. Your suggestion will bring people who have the email manager@microsoft.com and that's what I need.

  • schmid1208 Profile Picture
    87 on at

    @Jonas_Cruzrj, apologies I miss read your original message. Regardless, what I suggested should still work for you because it’ll return individuals who have that email particular email address. Then, if you want to get employees that report to that manager simply add the get direct reports action which will return the employees that report to that manager. Is that what you’re looking for? 

    -Reid

  • Jonas_Cruzrj Profile Picture
    14 on at

    Yes, that is it.

  • schmid1208 Profile Picture
    87 on at

    @Jonas_Cruzrj, that’s great! Let me know if you run into any additional troubles in testing, etc. 

  • Jonas_Cruzrj Profile Picture
    14 on at

    It doesn't work yet, sorry.

    "Flow saving failed with code 'InvalidTemplate' and message 'Template validation failed: 'The repeating actions 'Apply_every_4' referenced by 'inputs' in the action 'Filter_array' are not defined in the template.'.'.
    I tried:
    1) Search users
    2) Get the manager's email
    3) With the manager's email, I used the list filter to compare with the manager's email of the team I want to select.
    4) Based on this manager filter, I asked to Get user profile and finally display the user's birthday.

     

    Jonas_Cruzrj_0-1711199001444.png

     

    Jonas_Cruzrj_1-1711199105184.pngJonas_Cruzrj_2-1711199204423.png

     

  • schmid1208 Profile Picture
    87 on at

    @Jonas_Cruzrj, Thanks for sharing your screenshots! Let me quickly build the flow, then I’ll share the screenshots so you can copy it over to yours. That might be easier. 

  • schmid1208 Profile Picture
    87 on at

    Screenshot 2024-03-23 at 8.16.03 AM.png

  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Hi @Jonas_Cruzrj 
    Did you check graph explorer?
    If you don't want to loop through thousands of users via an apply to each (very slow) method to get birthdays, I can show you a very fast method using graph api.
    Just @mention me if you're interested

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 331 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard