Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Power Virtual Agents Flow (Get User Information o365)

Hello all,


i am trying to use a Question "Who are you looking for" is the question to get a input from the person using the bot.


What i am wanting to do is not to display the users information that is interacting with the bot bust for it to search the o365 users to display the requested information




Im getting the following error i cant resolve


Here is the flow. i dont want to resort to exporting the o365 users to excel then searching off that as staff change all the time.




Here is the flow working till the end






Unable to process template language expressions in action 'Return_value(s)_to_Power_Virtual_Agents' inputs at line '0' and column '0': 'The template language expression 'outputs('Get_user_profile_(V2)')?['body/displayName']' cannot be evaluated because property 'body/displayName' cannot be selected. Array elements can only be selected using an integer index.


Can you please help?


Dual Super User
Dual Super User

Hi @deno81,


A quick question to double check. Do you want to return a single person as a result or a set of people which match the search?

Super User
Super User

Hello @deno81 ,


You want to avoid the apply to each loop. PVA will not accept array values.

So you can use the expression first() to get the first UPN of the result from Search Users action.

Keep in mind this will have a limitation if the organization has duplicate display names, etc.




Now you can use the dynamic content of Get User Profile (V2), without being inside a loop.


Bypass Apply to each Loop – Flow Alt Delete – Josh Cook [Microsoft MVP]

Getting User Details To Use In Power Virtual Agents (Teams) – Flow Alt Delete – Josh Cook [Microsoft...




Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up

Proud to be a Flownaut!

Check out my blog for Power Automate tips,
tricks, and guides

Super User
Super User

Hi @deno81 ,

For your scenario, even you get the user details using the Get User from the Apply to Each statement, you have to assign the user information to variables, only then you will be able to assign those values to the response parameters.




- Architect Madhan

Please click the "Accept as Solution" button and give thumbs up, if it is helpful to you.

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (2,181)