Does your agent need to find a user’s country, access their phone number, job title, or route requests based on their department? You can add the Office 365 Users connector as a tool in Copilot Studio to handle this. The connector lets your agent call Microsoft Entra ID-backed profile data such as display name, email, department, job title, hire date, city, country, interests, skills, birthday and more.

This post will explore the Office 365 Users action called Get my profile (V2). See here for the full list of available outputs from the action.

This post will detail how to obtain the details of the user speaking to the agent. It uses the Get my profile (V2) action. However, this could be replaced by looking up any other email address in your tenant too (e.g. if you wish to build a “Staff Finder/FAQ” type of agent, that can look up details of any user across your organisation). If so, this would use the action Get user profile (V2) instead.

If you only want to obtain details such as the user’s name, language and email address, you do not need to enable the Office 365 Users connector. These variables should already be available to your agent if the user is authenticated.

Add Get my profile (V2) tool

Go to either the Overview or Tools tab of your agent in Copilot Studio, and select +Add tool.

Screenshot of the Copilot Studio interface showing the 'Staff Helper' section with tabs for 'Overview', 'Knowledge', and 'Tools'. The 'Tools' section contains options to add tools for AI engagement and manage agents.

Look for Office 365 Users connector and select the action called Get my profile (V2).

Interface for adding tools in a software application, featuring various connectors including Office 365 Users, with options to retrieve user profiles and related information.

Click Add and configure. You may need to sign in to enable the connection first if not already enabled.

Screenshot of the Copilot Studio interface showing the 'Get my profile (V2)' tool configuration, with options to add a connection and a highlighted 'Add and configure' button.

Configure the tool

You can give the tool a test without configuring anything. Type in the Test pane a phrase such as “Tell me about me” and it should return a list of some of the outputs from the Office 365 Users tool you just enabled. Try another phrase like “What department am I in”. You will see that the agent can already answer these basic questions by leveraging the tool.

Screenshot of a user interface in Copilot Studio showing the 'Get my profile (V2)' connector action, with sections for agent testing, description, outputs, and user details including name, email, job title, and company information.

You can control which outputs are available to the end user. Open Get my profile (V2) from the Tools tab of your agent. In the Completion area, expand Outputs.

Screenshot of Copilot Studio interface displaying the 'Completion' section with options for configuring agent responses after running and output availability.

To remove any outputs from your agent, change Outputs available to the agent and other tools to Specific. Then click onnext to the output you want to delete.

Screenshot of Copilot Studio interface showing the 'Outputs available to the agent and other tools' section, with options for output visibility and a list of outputs including 'Birthday' and a delete option.

The settings cog next to each output allows you to provide a description of when the agent should use the output. It may not be necessary to change this. E.g. a if the user enters a phrase such as “Where is my office?, it should automatically understand to return the user’s Office Location value.

Use the outputs in a topic

To use any of the outputs from the Get my profile (V2) tool within a topic, begin by opening your topic. Add a node to the topic and select Add a tool > Tool > Get my profile (V2).

Screenshot of a user interface in Copilot Studio, featuring the 'Add a tool' option under the 'Topics' section, with details for 'Get my profile (V2)' highlighted.

You can now tailor your conversation using the outputs as variables. Nodes after the tool step in the topic will have the outputs available as variables under Custom.

Screenshot of the Copilot Studio interface displaying the Staff Helper section, with a focus on user details, message composition area, and variable selection options.
Interface of Copilot Studio showcasing the 'Staff Helper' section, displaying user detail fields including surname, userPrincipalName, userType, and a message prompt.

Reference the tool in agent instructions / personalise agent behaviour

The tool can be added to the agent instructions to personalise the experience for each user. For example, the screenshot below shows the results of an instruction that responds with the local slang of the user’s country.

Screenshot of Copilot Studio displaying the Staff Helper overview, including instructions to respond using local slang and a welcome message for a new staff member.
“Respond using the local slang of the user’s country found in Get my profile (V2)”

In the Instructions area of your agent, you can type the / key to find and tag the Get my profile (V2) tool.

Screenshot of a user interface labeled 'Staff Helper' featuring sections for instructions, suggestions, and knowledge. Notable elements include a highlighted instruction to respond using local slang and a dropdown menu displaying options such as 'Get my profile (V2)' in red.

Leave a comment