Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Can I use "Get User Profile (V2)" using Nickname?

Like (0) ShareShare
ReportReport
Posted on 3 Oct 2022 22:40:55 by 21

Hi There - 

Thanks to you all for your answers in here; I've been able to teach myself a great deal from just reading the answers.  But I've gotten myself stumped with this one.

 

I have a Form I'm moving responses for to a Sharepoint (no issues with that part).  But as part of creating the full record, I'm attempting to look up the user the response is recorded for using a field on the form that is ultimately an employee ID.  That employee ID is located in the "Nickname" field within Azure.  Is there a way I can use the "Get User Profile (v2)" function to look up based on that employee ID within the Nickname field to return the user profile vs. searching by email only?  It works flawlessly returning it on the email address that's stored as part of the form entry, but in this case, I may have situations where the user making the entry may not be the user who the entry is for (such as a supervisor or support personnel).

  • codywalker Profile Picture
    21 on 10 Oct 2022 at 15:48:01
    Re: Can I use "Get User Profile (V2)" using Nickname?

    Thank you so much!  This solved not only my current conundrum, but a separate one I've been stumped on for a while and never revisited.

  • Verified answer
    Expiscornovus Profile Picture
    31,652 Most Valuable Professional on 04 Oct 2022 at 10:04:37
    Re: Can I use "Get User Profile (V2)" using Nickname?

    Hi @codywalker,

     

    The Get User Profile (V2) action only allows you to retrieve a profile based on either the User principal name or id. There is also a Search for Users (V2) action. That allows you to search within the display name, given name, surname, mail, mail nickname and user principal name.

     

    Are you using an extensionattribute in Azure Active Directory or do you actually mean the mailNickName attribute?

    https://learn.microsoft.com/en-us/azure/active-directory-b2c/user-profile-attributes

     

    In case of the second scenario you could use a Search for Users (v2) action instead.

     

    mailnickname_searchforusers.png

     

    Alternatively, you could also use a Graph API list users method with a $filter query parameter in a Send an HTTP request action (Office 365 Groups connector)

     

    https://graph.microsoft.com/v1.0/users/?$filter=mailNickname eq '@{variables('employeeID')}'&$select=id,mail

     

    workaround_getuserprofile.png

     

     

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 39

#2
Churchy Profile Picture

Churchy 20

#3
Chriddle Profile Picture

Chriddle 19 Super User 2025 Season 1

Overall leaderboard
Loading started