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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / get user (AAD) error 404
Power Automate
Unanswered

get user (AAD) error 404

(0) ShareShare
ReportReport
Posted on by 220

very simple action AAD get user>getting 404 error 

{
  "error": {
    "code": "Request_ResourceNotFound",
    "message": "Resource 'ms@contoso.com' does not exist or one of its queried reference-property objects are not present.",
    "innerError": {
      "request-id": "a6677627-0a77-4dc2-9ac6-356882803925",
      "date": "2019-12-23T16:33:25"
    }
  }
}

 

===========================

whole thing I would to check if user exists>yes or no. if does exit, if not create user. 

 

I am using UPN in get user field. If I remove user from AAD, works fine.

 

get_user.png

Categories:
I have the same question (0)
  • efisher Profile Picture
    52 on at

    @usarif you need to change settings on you condition step and "Configure run after" to run after checking for your user is ether successful or failed 

    check.PNG

  • usarif Profile Picture
    220 on at

    still getting same error even choose the option to "Configure run after" to run

  • usarif Profile Picture
    220 on at

    I think issue is in condition after get user azure. I couldn't find output from get user. what condition qualify here.

    get_user.png

     

     

  • Verified answer
    efisher Profile Picture
    52 on at

    @usarif 

    When you check if the user in AD the action will result in true (user is in AD) or false (user is not in AD),in your screenshot the user you are checking for is not in AD so the response is correct - false or it will show up as failed action.

    Now in your condition if the Response code is 404 then create new user otherwise update item in SP

    below is screenshot of the old flow that's been running since last December - I am checking if there is ID in the body of the result using this formula: @not(empty(body('Get_user')?['id']))

    First image: user is in AD - I add them to SP security group

    Second one: user is Not in AD - create as guest user in AD, pause, add to SP security group send invitation 

     

    UserInAD.PNG

     

    User not in AD

    UserNotAD.PNG

  • efisher Profile Picture
    52 on at

    I see! yes your condition is not correct one you should check if the status code is 404

    to do this you will need to Initialize variable (integer) and set it to the following expression: outputs('Get_user')['statusCode']

    now in your condition you will check if the statusCode is equal to 404, make sure your Initialize variable is also Configured to run after success or fail.

     

    statusCode.PNG

  • usarif Profile Picture
    220 on at

    i am getting error when trying to create action Initialize variable after get user "the operation initialize variable can only be used at top level"

  • Verified answer
    v-bacao-msft Profile Picture
    on at

     

    Hi @usarif ,

     

    Variables cannot be initialized in Apply to each.

    You could use expression directly in Condition to get statusCode. And set configure run after in Condition.

    Image reference:

    214.PNG

     

    Best Regards,

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard