Define custom attributes for user flows
This article applies to B2B collaboration user flows. If your tenant is configured for customer identity and access management, see Collect user attributes during sign-up for customers.
For each application, you might have different requirements for the information you want to collect during sign-up. Microsoft Entra External ID comes with a built-in set of information stored in attributes, such as Given Name, Surname, City, and Postal Code. With Microsoft Entra External ID, you can extend the set of attributes stored on a guest account when the external user signs up through a user flow.
You can create custom attributes in the Microsoft Entra admin center and use them in your self-service sign-up user flows. You can also read and write these attributes by using the Microsoft Graph API. Microsoft Graph API supports creating and updating a user with extension attributes. Extension attributes in the Graph API are named by using the convention
extension_<extensions-app-id>_attributename. For example:
<extensions-app-id> is specific to your tenant. To find this identifier, navigate to Identity > Applications > App registrations > All applications. Search for the app that starts with "aad-extensions-app" and select it. On the app's Overview page, note the Application (client) ID.
Create a custom attribute
Steps in this article may vary slightly based on the portal you start from.
Browse to Identity > External Identities > Overview.
Select Custom user attributes. The available user attributes are listed.
To add an attribute, select Add.
In the Add an attribute pane, enter the following values:
- Name - Provide a name for the custom attribute (for example, "Shoe size").
- Data Type - Choose a data type (String, Boolean, or Int).
- Description - Optionally, enter a description of the custom attribute for internal use. This description isn't visible to the user.
The custom attribute is now available in the list of user attributes and for use in your user flows. A custom attribute is only created the first time it's used in any user flow, and not when you add it to the list of user attributes.
Once you've created a new user using a user flow that uses the newly created custom attribute, the object can be queried in Microsoft Graph Explorer. You should now see ShoeSize in the list of attributes collected during the sign-up journey on the user object. You can call the Graph API from your application to get the data from this attribute after it's added to the user object.