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 / Error on get User Profile
Power Automate
Answered

Error on get User Profile

(0) ShareShare
ReportReport
Posted on by 25
Good afternoon
 
I have a list of email names which rely on get User Profile to give me the names.
 
The flow does an apply to each to get the email address and convert it to a name.
 
I have names in the list which sometimes have been removed due to leaving the company, so when the Get user details is used, sometimes it throws up an error.
 
I have a dual flow which if the error occurs, it adds a comment in the name, however i would like to do a process where the the flow checks for the presence of the address before i try to retrieve the information and get an error. 
 
The multiple errors shuts down my flow. 
 
What is the best way to approach this? Flow images are below. I look forward to hearing from you.
 
Categories:
I have the same question (0)
  • Verified answer
    Ellis Karim Profile Picture
    11,940 Super User 2026 Season 1 on at
     
    One approach is to use the Search for users action then count (using the length function) how many users were found. A count or length greater than 0 means that users were found. (You could also set the condition to 'equal to 1').
     
     
    The Search for users action will return an array. If the search returned users, we just need the first item from the array and then we extract the DisplayName:
    first(outputs('Search_for_users_(V2)')?['body/value'])?['DisplayName']
    Sample runtime of the "Search for users" action:

    [
      {
        "Id": "5e7cd825-98dc-4cfa-bd0f-cd023d745984",
        "AccountEnabled": true,
        "BusinessPhones": [
          "+1 858 555 0110"
        ],
        "City": "San Diego",
        "Country": "United States",
        "Department": "Sales & Marketing",
        "DisplayName": "Alex Wilber",
        "GivenName": "Alex",
        "JobTitle": "Marketing Assistant",
        "Mail": "AlexW@onMicrosoft.com",
        "MailNickname": "AlexW",
        "OfficeLocation": "London",
        "PostalCode": "92121",
        "Surname": "Wilber",
        "UserPrincipalName": "AlexW@onMicrosoft.com"
      }
    ]


     
    Ellis Karim
     
     
     
     
     
     
     
     
     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard