Introduction

In this article, we are going to discuss the approach to get a user profile in Microsoft Power Automate using the default action "Get user profile (V2)" from the "Office 365 Users" connector. This action lets you retrieve the specified user's user profile information in a JSON object.

To use this action, you must provide the User Principal Name (UPN) or email address of the user whose profile you want to retrieve. You must also specify which user profile properties you wish to retrieve by providing a comma-separated list of property names. You can then use this information in subsequent actions or steps in your flow.

Here are the steps to get user properties using the "Get user profile (V2)" action,

Create a New Flow

Figure 1: Power Automate window for new flow

Figure 1- Power Automate window for a new flow

Figure 2: Creating Instant cloud flow

Figure 2- Creating Instant cloud flow

With the "Get user profile" action

Figure 3: Adding Get user profile (v2) action

Figure 3- Adding Get user profile (v2) action

Figure 4: Retrieved data with Get user profile action

Figure 4- Retrieved data with Get user profile action

User Profile Properties

Here are a few examples of user properties that can be retrieved using the "Get user profile" action, along with the property type and details. These properties can be added as dynamic content to the next step in the flow.

Property Type Description
Display Name String To create a user, providing the name, usually a combination of the first, middle, initial, and last names, is mandatory. This property cannot be cleared during updates, and its maximum length is restricted to 256 characters.
Given Name String This property represents the user's first name, and its length cannot exceed 64 characters.
Surname String This property represents the user's last name, with a maximum length of 64 characters.
Nickname String The mail alias for the user. This property must be specified when a user is created. Maximum length is 64 characters.
Birthday DateTimeOffset The date of birth of the user.
Business Phones String collection This property is a collection of strings that holds the user's phone numbers, but it only allows setting one number.
Hire Date DateTimeOffset The user's hire date is always expressed in UTC.
User Type String This property classifies user types, such as "Member" and "Guest".
Mail String This property contains the SMTP address for the user, for example, [email protected].
User Principal Name String The user principal name (UPN) of the user. The UPN is an Internet-style login name for the user based on the Internet standard RFC 822. By convention, this should map to the user's email name. The general format is alias@domain, where the domain must be present in the tenant's verified domain collection. The verified domains for the tenant can be accessed from the verifiedDomains property of the organization. This property is required when a user is created.


Conclusion

In conclusion, the "Get user profile" action in Power Automate allows you to retrieve specific properties of a user's profile from a connected system. Once you've retrieved the user's profile, you can use the dynamic content feature in Power Automate to insert the retrieved properties into subsequent actions, such as customizing notifications, assigning tasks, or tracking activities within a workflow or business process.

This action provides you with specific information about a user that can be used to streamline processes and improve efficiency within your organization.

Furthermore, the next article will discuss retrieving user profiles using Graph API in Power Automate.