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 / How to error handle Ge...
Power Automate
Answered

How to error handle Get Manager (v2)

(0) ShareShare
ReportReport
Posted on by 80
I'm trying to condition the output of Get manager (v2). If it returns something, then do something. If it returns nothing (because the AD team didn't populate the users O365 profile properly), do something else. Checking if the manager name or email is null doesn't work here: in ~25% of use cases, the user profile has NO manager at all: there is no manager attribute data to check for null values. The Get manager (v2) call fails completely in these cases. 
 
I've tried:
length(outputs('Get_manager_(V2)')?['body/value']) is equal to false
length(outputs('Get_manager_(V2)')?['body/value']) is equal to ""
length(outputs('Get_manager_(V2)')?['body']) is equal to false
length(outputs('Get_manager_(V2)')?['body']) is equal to ""
emptyoutputs('Get_manager_(V2)')?['body'] is equal to false
emptyoutputs('Get_manager_(V2)')?['body'] is equal to ""
emptyoutputs('Get_manager_(V2)')?['body/value'] is equal to false
emptyoutputs('Get_manager_(V2)')?['body/value'] is equal to ""
 
All fail
 
Categories:
I have the same question (0)
  • Suggested answer
    mrcwojcik Profile Picture
    51 on at
    Try something like this:
     
    First you're fetching manager.
    If this action fail -> go to Scope: not exist - and handle it how you want.
    If this action will be success -> Scope not exist will be skipped and on Scope: exist but wrong data (use Configure after: is last action skipped) - and handle blanks, nulls or others.
  • Verified answer
    Ellis Karim Profile Picture
    11,684 Super User 2025 Season 2 on at
     
     
    Another approach you could try is to use the Office 365 Users "Send an HTTP request". This is not a premium connector:
     
    Power Automate Get User profile V2 action
     
    Power Automate Office 365 Users "Send an HTTP request"
    https://graph.microsoft.com/v1.0/users/<user-id>?$expand=manager($select=id,displayName,mail)
     
    The user-id used in the Send an HTTP request is from the Get User profile (V2) action.
     
    Using a Compose action, select the Manager property from the output of the Office 365 Users "Send an HTTP request":
    Power Automate Compose Action to get Managers from the Office 365 Users Send an HTTP Request
    body('Send_an_HTTP_request')?['manager']
     
    Next, check to see of the Manager property is empty (i.e. the user doesn't have a Manager assigned):
     
    Power Automate condition to check if a user has a line manager
     
     
    Use the following expressions to extract the properties of the Manager: user-id (this is the UPN), display Name and email address:
     
    outputs('Compose')?['id']
    outputs('Compose')?['displayName']
    outputs('Compose')?['mail']
     
    If you want other properties, add these to URI of the Send an HTTP request". Here are some examples:
     
    id
    deletedDateTime
    accountEnabled
    businessPhones
    city
    companyName
    country
    createdDateTime
    creationType
    department
    displayName
    givenName
    jobTitle
    mail
    mailNickname
    mobilePhone
    otherMails
    officeLocation
    postalCode
    
    
     
     
     
    Power Automate condition showing how to handle no line manager found
     
     
     

    Ellis Karim Ellis Karim
    Blog | LinkedIn | Bluesky

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard