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 / 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,735 Super User 2025 Season 2 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

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
David_MA Profile Picture

David_MA 245 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 207 Most Valuable Professional

#3
trice602 Profile Picture

trice602 185 Super User 2025 Season 2

Last 30 days Overall leaderboard