Notifications
Announcements
Hello Community,
When creating variables in Power Virtual Agents, it looks like we would always have to start with a question before we would get the option to create a variable. Is there a way we could create the bot variables outside of a question/node? the issue for creating the variable in a question is that if we delete the question node then we would lose the variable. How can we create a variable and keep it to use for a bot topic, without having to associate the variable with any particular question or node?
Thanks.
Hi @D365EL,
In the unified authoring canvas, you can define and manipulate variables directly in the topic canvas.
Work with chatbot variables - Power Virtual Agents | Microsoft Learn
In the classic version, outside of question nodes, you can initialize and update variables using the Bot Framework Composer. See an example of how to initialize and how to update a PVA variable with BFC here: Solved: Re: Integrate a PVA chatbot with Azure OpenAI Chat... - Power Platform Community (microsoft.com)
Henry
Hi @HenryJammes , thanks for the info. So using the unified authoring topic canvas, I see we can create a new variable using the variable management option in my screen shot below, and select Set a variable value, then create the new variable:
In this scenario, I want to create a global variable that is going to be set by an external source. I defined the variable as below. So in this case, do I simply leave the "To value" field blank? because it's going to be set by an external source, so I am not setting any value here. If this "To value" is required to be populated, what and how should I populate this since this is going to be set by an external source? Am I doing this right?
Please advise, thank you!
Good question, I don't know if you can leave it undefined or if you shouldn't set it to a blank value (="")
Hi @HenryJammes , but if we set it to a blank value, I am worried if it's going to overwrite what the external source would be setting this variable. Essentially what I am looking to do is to create a global variable to be used by this topic, and this global variable would be set by an external source...
Is that the right area to create new variables outside of any given node - just wanted to make sure I got this part right when you said I could create variables within the topic canvas
@CleberM maybe that's something you know for OC + PVA unified canvas integration?
Hi,
This is something we are working on. As a temporary solution, @D365EL you can create a separate topic without trigger queries and put "Set a variable value" nodes there. You can put any value of the variable here as they won't be used, however it is important to assign the value of the correct type. E.g. if your external variable is number, please assign 0, if your external variable is string, assign an empty string. This is needed for PVA to correctly identify the type of the variable. As the topic won't be triggered, the actual values don't matter.
@Robulane , that's a great idea, thank you!
@Robulane , if you don't mind me asking, what's the syntax for setting an empty string in that value field?
Thank you @HenryJammes!
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Michael E. Gernaey 251 Super User 2025 Season 2
Romain The Low-Code... 201 Super User 2025 Season 2
S-Venkadesh 93 Moderator