cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anuj89822
Frequent Visitor

how to get user value back to PVA from Bot Framework Composer?

Hi All,

 

how to get user value back to PVA from Bot Framework composer? I am creating PVA bot and i am also using Bot framework Composer to create adaptive card to show to my PVA chatbot. i also have to do some operation with power flow but i am not able to get the user value to PVA chat about.

 

Need help on this.

1 ACCEPTED SOLUTION

Accepted Solutions
anuj89822
Frequent Visitor

Hi, i got the answer for this. 

  • you need to create global variable in you pva. that can be created in any topic and select as external source can access too

anuj89822_0-1626501569115.png

  • in bot framework console you need, you need to set properties and provide variable name as virtualagent.same name given in PVA and provide the value which you want to pass. and that will work.

View solution in original post

9 REPLIES 9
Expiscornovus
Dual Super User
Dual Super User

Hi @anuj89822,

 

Can you maybe share a couple of screenshots to show what value you want to get back. Is it something from the flow? Or do you just mean the details of the user interacting with the bot?

 

If it is the latter you should be able to use the bot.UserId & bot.UserDisplayName. After you have enabled authentication on your bot in the settings.

 

botusernameanduserid.png

Hi, 

 

I am trying to get the value from Bot frame work composer to PVA. 

 

Regards,

Anuj

anuj89822
Frequent Visitor

Hi, i got the answer for this. 

  • you need to create global variable in you pva. that can be created in any topic and select as external source can access too

anuj89822_0-1626501569115.png

  • in bot framework console you need, you need to set properties and provide variable name as virtualagent.same name given in PVA and provide the value which you want to pass. and that will work.
nk1ng
Helper II
Helper II

How to you get an array to it?  I am struggling with o365, search for profiles v2...   

anuj89822
Frequent Visitor

@nk1ng if you can explain more. I can try to explore.

Sure, basically, I am trying to make a topic that will allow you to enter a name and you will get adaptive card carousel for the search term - basically, global address book. 

 

I am having issues trying to load the return from "Search for user (V2)" to the composer.  I was not able to pass an array back from the flow so with concat I just appended everything to a string but now it's a string, need to be an array or json or something to parse it into the adaptive cards in the composer.  That made sense?  

 

Here is what I am trying but how to you get the json into the composer?

nk1ng_0-1626797350419.png

 

Everything worked when I statically hardcode into the composer but I want the flow from the search_for_users_(v2) instead... 

 

anuj89822
Frequent Visitor

@nk1ng do let me know, if i understand you issue correctly.

Hi,  I am passing two global variable value from PVA to bot framework composer. created global variable in PVA and using same variable name in framework composer. below screenshot for your reference. 

anuj89822_0-1626938150564.png

 

I got that however I need a json or array to run foreach in the composer as I want to get multiple entries from the Search_for_users_(v2) flow..

nk1ng
Helper II
Helper II

Welp, I finally got it.

Flow (and set for the 'return' to be global in PVA):

nk1ng_3-1627562804816.png

 


Composer (Create Tab; I used json func here for the string return from PVA to go back to an array in composer):

nk1ng_4-1627563094893.png

 

Composer (Bot responses tab):

nk1ng_1-1627562536034.png

and

nk1ng_2-1627562595348.png

 

The only caveat now is the image for the user, which will work in the test bot however when you publish it to teams won't show the image.  Still working on that...

Helpful resources

Announcements
Canadian Cloud 2022 768x460.png

Register for a free PVA chatbot creation workshop.

Learn how to respond rapidly to your customers and employees at scale, using intelligent conversational chatbots.

MS Build PVA Carousel 768x480.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development for Power Virtual Agents.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (1,294)