cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AzzaB
Regular Visitor

Pass variable from Bot Framework back to PVA

Hello, I've been looking at creating an adaptive card submit form to retrieve info from users in PVA.  The form itself works great except I'm unsure now how I can then use the submitted data. 

 

Once a user submits a form how can I can use that data for example add it to a SharePoint list etc?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @AzzaB.

It is possible today to return variables from a Composer dialog, which you can then use within PVA, to do things like call a Flow, for example.

 

To do this, you need to set the input / output properties on your Composer dialog. In the screenshot below, I have added two output properties (Variable1 and Variable2, both strings).

 

dialog-interface.png

 

Once you have configured your output variables, you can assign values to them within Composer. They sit within the dialog result, so to assign a value to Variable1, you would set your value into dialog.result.Variable1 (an example of this is shown below).

 

set-property.png

 

Finally, once you publish your Composer dialog back to PVA and add a redirect to it to your canvas, you will see the output variables are now shown and are available to use within PVA.

 

composer-dialog.png

 

Right now, you are limited to multiple primitive properties, as opposed to returning objects, which means you might need to do some variable manipulation within Composer.

 

Does this help with what you are looking to achieve?

View solution in original post

8 REPLIES 8

Hi @AzzaB.

It is possible today to return variables from a Composer dialog, which you can then use within PVA, to do things like call a Flow, for example.

 

To do this, you need to set the input / output properties on your Composer dialog. In the screenshot below, I have added two output properties (Variable1 and Variable2, both strings).

 

dialog-interface.png

 

Once you have configured your output variables, you can assign values to them within Composer. They sit within the dialog result, so to assign a value to Variable1, you would set your value into dialog.result.Variable1 (an example of this is shown below).

 

set-property.png

 

Finally, once you publish your Composer dialog back to PVA and add a redirect to it to your canvas, you will see the output variables are now shown and are available to use within PVA.

 

composer-dialog.png

 

Right now, you are limited to multiple primitive properties, as opposed to returning objects, which means you might need to do some variable manipulation within Composer.

 

Does this help with what you are looking to achieve?

Hi @GaryPrettyMsft ,

 

I think that is exactly what I'm looking for!  I'm not particularly experienced so I'll have a play around with it, but as you have described sounds perfect.  Thank you very much!

 

Cheers,

Azza.

Monkeyman
Resolver III
Resolver III

Hi,

 

I am trying to achieve this same functionality, but I do not get the variable ouputs showing on the topic redirect in PVA.  Any ideas?

For me the key point was as Gary said, defining the input / output in the dialog interface.  E.g. 

bot1.png

 

Then when I did the redirect it shows those 2 outputs and I can use them in the flow

AzzaB_1-1646403244489.png

hope that helps!

In addition to AzzaB's response, if you added the redirect and then changed the topic, remove it and re-add and it should show the outputs.

Gary, do you know of a place that shows this in practice with an Adaptive Card with a Submit button? I am having trouble with getting the value from the Adaptive Card out.

Hi Gary , I have a trouble getting the dialog.result variables back into PVA Bot while using the Adaptive Card with submit Action. 
- I have Adaptive card in a child dialog and ensured to add the output variables in the Dialog

- I have updated the Dialog.result.variable to  value from the current turn 

- After  publishing in bot framework composer , I can see the variables in PVA Topic

- But, When I try to use the output variable in a next step and Save - the Save Fails showing that the Bot contains Unknown variable and the output variable of child dialog disappears

kacham_0-1652174570995.png

kacham_1-1652174826909.png

kacham_2-1652174926530.png

Can you please help to understand the issue here , and suggest anything that Im missing here

 

How can we access the Input variables in Dialog Interface. I am unable to access this via dialg.input.variable

Helpful resources

Announcements
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.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Kudoed Authors
Users online (3,211)