| title | description | keywords | ms.date | ms.topic | author | ms.author | ms.reviewer | ms.custom | ms.service | ms.collection |
|---|---|---|---|---|---|---|---|---|---|---|
Add input and output variables |
Pass variables between a Power Automate flow and a Power Virtual Agents bot. |
PVA, flow, automate |
07/28/2022 |
article |
iaanw |
iawilt |
peterswimm |
flow, ceX, advanced-authoring |
power-virtual-agents |
virtual-agent |
Use variables as input and output parameters to pass information between Power Automate flows and Power Virtual Agents bots.
Important
A bot can only receive up to 1 MB of data from a flow in a single action. However, there's no limit on the amount of data a bot can send or how many variables a bot can pass.
In this example, you'll create a flow with an input parameter and return it to a bot as an output parameter.
- Learn more about what you can do with Power Virtual Agents.
- Understand how to create a flow from the Power Virtual Agents authoring canvas.
Bots can use the following types of inputs and outputs with Power Automate flows:
- Number
- String
- Boolean
The following types aren't supported:
- Object
- Date
- Timestamp
- List [String]
- List [Number]
- List [Boolean]
- List [Object]
- List [Date]
- List [Timestamp]
-
Go to the Topics page for your bot.
-
Create a new topic called Echo message.
-
Add the trigger phrase echo.
-
Add a Question node and enter the message Tell me something and I'll say it back to you.
-
For Identify, choose User's entire response.
-
For Save response as, select the pencil icon and rename the variable to userResponse.
:::image type="content" source="media/advanced-flow-input-output/new-topic.png" alt-text="Screenshot of a Question node.":::
-
On the authoring canvas, select Add node (+). Select Call an action, and then select Create a flow.
-
In the Power Automate portal, name the flow Echo parameter.
-
In the Power Virtual Agents flow trigger, select Add an input.
:::image type="content" source="media/advanced-flow-input-output/PVAConnector_Inputs_1.png" alt-text="Screenshot of a Power Virtual Agents flow trigger, with Add an input highlighted.":::
-
Select Text and enter the name String_Input.
:::image type="content" source="media/advanced-flow-input-output/PVAConnector_Inputs_2.png" alt-text="Screenshot of the flow trigger input.":::
-
In the Return value(s) to Power Virtual Agents response action, select Add an output.
:::image type="content" source="media/advanced-flow-input-output/PVAConnector_Output_1.png" alt-text="Screenshot of the flow response action, with Add an output highlighted.":::
-
Select Text and enter the name String_Output.
:::image type="content" source="media/advanced-flow-input-output/PVAConnector_Output_2.png" alt-text="Screenshot of the response action output." :::
-
For the value of String_Output, select the String_Input variable.
:::image type="content" source="media/advanced-flow-input-output/use-input-variables-for-output.png" alt-text="Screenshot of an input parameter selected as the value of an output parameter.":::
-
Select Save.
-
On the Power Virtual Agents authoring canvas, select Add node (+), and then select Call an action.
-
Select the flow you created earlier, Echo parameter.
-
For String_Input(text) gets value from, select userResponse.
-
Add a Message node. Select Insert variable, and then select String_Output.
:::image type="content" source="media/advanced-flow-input-output/action-node.png" alt-text="Screenshot of an Action node for the Echo parameter flow.":::
-
Test your topic in the Test bot pane.
:::image type="content" source="media/advanced-flow-input-output/test-bot.png" alt-text="Screenshot of a bot conversation.":::
Alternatively, instead of using a variable as an action's input parameter, you can type the value directly into the "gets value from" box.
:::image type="content" source="media/advanced-flow-input-output/literal-value.png" alt-text="Screenshot of a literal value passed as an input parameter.":::
[!INCLUDEfooter-include]