Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Solution
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Check whether user exists in AAD with Power Automate

Posted on March 26, 2023March 26, 2023 by Tom

“I’d like to check whether a user with specific email address exists in our company’s Active Directory, can I use Power Automate to do that?”


When you’re working with email addresses, there’s always a difference whether it’s an internal or an external address. If it belongs to a user from your company, you can retrieve all his information from the Active Directory. On the other side, external email address is all you get, there’s no place to learn more about the user. But how do you check whether the user belongs to your company or not? Whether you can get this extra information?

Use ‘Run after’ after the ‘Get user profile’ action

If you know the user email address or his id, you can use the ‘Get user profile’ action. The small problem with this action is that it’ll fail for non-existing users.

But you can take it as a valid result (as when updating files) using the ‘Configure run after’ settings on the following actions.

Set the action to run after the ‘Get user profile’ has failed and define what to do when the user doesn’t exist.

Power Automate check user exists

Search for the user with an HTTP request

The second option, if you don’t want to deal with the ‘Run after’ settings, is to use an HTTP request. As explained in the previous article, you can search for a user using more properties than just his email or id. The HTTP request won’t fail for non-existing users, it’ll return either the user or an empty array.

Method: GET

Uri:
https://graph.microsoft.com/v1.0/users?$filter=<property> eq '<value>'

Check whether the output is empty (user doesn’t exist) or not (user exists), and continue accordingly.

empty(body('Send_an_HTTP_request')?['value'])
Power Automate check user exists

Summary

You’ve got two options how to check whether a user exists using Power Automate – a dedicated action or an http request. If you use the dedicated action, you’ll have all the information available as dynamic content, but you must use the not so common ‘run after’ settings. The HTTP request evaluation is simpler with a condition, on the other side you must extract the user information from the response JSON.


πŸš€ Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

3 thoughts on “Check whether user exists in AAD with Power Automate”

  1. Sandy says:
    June 21, 2023 at 1:44 am

    Hi,

    How can we send email to O365 group email address when it is in ‘CC’ email body from power automate. Get user profile doesn’t recognize group/distribution list email and return user not found error.

    Reply
    1. Tom says:
      August 12, 2023 at 11:03 pm

      Hello Sandy,
      you can just type in the email address if you know it, no need to get user profile.

      Reply
  2. UJ says:
    August 19, 2024 at 8:12 pm

    I’m using get user profile for this particular flow, it has two apply to each actions and the get user profile is in the last apply to each action. It was tested and was working fine. But in production, the flow is running for hours. It’s a scheduled flow… Do you think changing it to a HTTP request would change that?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,100+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Get the Approval Process solution and the Task Delegation App to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes