Skip to content

Latest commit

 

History

History
122 lines (73 loc) · 4.55 KB

File metadata and controls

122 lines (73 loc) · 4.55 KB
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

Add input and output variables

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.

Prerequisites

Supported parameter types

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]

Create a topic and flow

  1. Go to the Topics page for your bot.

  2. Create a new topic called Echo message.

  3. Add the trigger phrase echo.

  4. Add a Question node and enter the message Tell me something and I'll say it back to you.

  5. For Identify, choose User's entire response.

  6. 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.":::

  7. On the authoring canvas, select Add node (+). Select Call an action, and then select Create a flow.

  8. In the Power Automate portal, name the flow Echo parameter.

Add input parameters to the flow

  1. 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.":::

  2. 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.":::

Add output parameters to the flow

  1. 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.":::

  2. 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." :::

  3. 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.":::

  4. Select Save.

Select variables in the bot topic

  1. On the Power Virtual Agents authoring canvas, select Add node (+), and then select Call an action.

  2. Select the flow you created earlier, Echo parameter.

  3. For String_Input(text) gets value from, select userResponse.

  4. 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.":::

  5. 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.":::

Optionally use literal values for input parameters

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.":::

See also

Use variables

[!INCLUDEfooter-include]