Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Power Virtual Agents Flow (Get User Information o365)

(0) ShareShare
ReportReport
Posted on by 2

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

deno81_0-1647770884627.png

deno81_1-1647770915760.png

 

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.

 

deno81_2-1647771048531.pngdeno81_3-1647771082113.pngdeno81_4-1647771106012.png

 

Here is the flow working till the end

deno81_5-1647771382920.pngdeno81_6-1647771458223.png

deno81_7-1647771501788.png

deno81_8-1647771555740.png

 

 

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?

 

  • Expiscornovus Profile Picture
    31,641 Most Valuable Professional on at
    Re: Power Virtual Agents Flow (Get User Information o365)

    Hi @JB261,

     

    You can use markdown for that and format it as a table. I have actually written a blog about that approach:

    https://powerusers.microsoft.com/t5/Power-Virtual-Agents-Community/How-to-use-mark-down-to-format-a-table-for-the-bot-response/ba-p/1190942

     

  • JB261 Profile Picture
    on at
    Re: Power Virtual Agents Flow (Get User Information o365)

    Hello @Expiscornovus I have a same scenario on this and have been stuck for a few days find a solution, maybe you can give an idea.  The problem on my side is I want to show in the bot that the output is in arrange.

    Here the scenario 
    User: Juan
    Bot: JUAN L. DELA CRUZPUBLIC ACCOUNTANTJUAN L. ANGELODRIVER
           JUAN M.MANUELBOOK KEEPER

    This is what output I want,

    Boot: JUAN L. DELA CRUZ

             PUBLIC ACCOUNTANT

             JUAN L. ANGELO

             DRIVER
             JUAN M.MANUEL

             BOOK KEEPER

     

    please see my flow below 

     

    JB261_0-1679664485413.pngJB261_1-1679664505590.png

     

  • ArchitectMadhan Profile Picture
    1,580 on at
    Re: Power Virtual Agents Flow (Get User Information o365)

    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.

    ArchitectMadhan_0-1648216011701.png

     

     

  • Jcook Profile Picture
    7,770 Most Valuable Professional on at
    Re: Power Virtual Agents Flow (Get User Information o365)

    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.

    Example:

    Jcook_0-1648187872389.png

    first(outputs('Search_for_users_(V2)')?['body/value'])?['UserPrincipalName']

    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 MVP]

     

    Thanks!

     

  • Expiscornovus Profile Picture
    31,641 Most Valuable Professional on at
    Re: Power Virtual Agents Flow (Get User Information o365)

    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?

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow