web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / bring the one topic va...
Copilot Studio
Unanswered

bring the one topic variables to another topic

(0) ShareShare
ReportReport
Posted on by 24

Hi Everyone.

 

Is it possible to bring the one topic variables into another topic so that we can use that in condition.

 

Thank you in Advance.

Categories:
I have the same question (0)
  • nesrivastava Profile Picture
    Microsoft Employee on at

    Hi,

    If I understand you correctly, you want to access topic A variable in topic B. Instead of creating a topic level variable, create a global level variable. 
    https://learn.microsoft.com/en-us/power-virtual-agents/authoring-variables-bot?tabs=webApp 

  • NadeemAhamed Profile Picture
    24 on at

    Thank you for your valuable time to reply.

     

    By using the above option i can use the Topic A variable in Topic B. but iam not getting how to use "if, if else and else if condition" in PVA condition activity by using that variables.

     

    Example:- 

    I have multiple Topic's such as Topic A,B,C,D.... and at the end of the flow we are redirecting users to one common topic  "End of Conversation"

    When user is coming from different topic we should show different specific message by using variables in condition.

     

    if (variable==A)

    { message="your coming from Topic A"}

    else if (variable==B)

    { message="your coming from Topic B"}

    else if (variable==C)

    { message="your coming from Topic C"}

    else 

    {message="your coming from Topic Z"}

    ......

     

  • nesrivastava Profile Picture
    Microsoft Employee on at

    Hi @NadeemAhamed ,

    As per your example, I created the same scenario. Here is the Final Output you will get it:

    nesrivastava_0-1697087297797.png

    Steps:

    • I chose two pre-built topics, Lesson-1 and Lesson-2, from my bot.
    • On Lesson-1, just before redirecting to the "End of Conversation," I created a global variable named "SelectTopic."
    • For the Value of this variable, I input my topic name as "Lesson 1 - A simple topic," but you should use your own topic name.

    nesrivastava_1-1697087315651.png

    • I replicated the same process on Lesson-2.

    nesrivastava_2-1697087339363.png

     

     

    • In the "End of Conversation" topic, I added a condition to control the conversation's redirection based on the topic.

    nesrivastava_3-1697087359961.png

     

    • The end result of this process will enable your chatbot to display different specific end messages to users based on the topic they interacted with.

      Let me know if you if it works for you.
      Thanks
      @HenryJammes , FYI
  • MattJimison Profile Picture
    579 Most Valuable Professional on at

    Hi, @NadeemAhamed .

     

    If you want to input and/our output variables from one topic to another, without using global variables as @nesrivastava  mentioned, you simply click on the "{x}" menu option in a topic and you can then set variables to be incoming and/or outgoing. If a topic has an incoming variable, when you redirect to it, the UI will change to allow you to pass in the value (per screenshot shown). Likewise, if a topic has an outgoing variable, you can capture it after the redirect node (per screenshot shown).

     

    This makes it really easy to add a variable to your 'End Conversation' topic called "ReferringTopic", setting it as incoming, and then from each topic you redirect to 'End Conversation' you can pass a static or dynamic value. Both the global variable option and the input/output topic variable option will work; it comes down to preference, but having inputs/outputs is a clean way to do it without unnecessarily adding more variables to the global scope.

     

    MattJimison_0-1697155467453.png

     

    MattJimison_2-1697155585992.png

     

    MattJimison_3-1697155697718.png

     

     

    Cheers,

    Matt

     


    Find this post helpful? Please mark it as the solution and/or provide kudos so that it will help others in the future.

    Cheers,
    Matt

  • NadeemAhamed Profile Picture
    24 on at

    @nesrivastava,

    I have tried above option but i am not able to find the topic names in "End of Conversation" while assiging values.

    I have enabled the @MattJimison  options to bring the topic's to value for global variable.

    NadeemAhamed_2-1697180899370.png   

    NadeemAhamed_3-1697180910342.png 

    NadeemAhamed_4-1697180913635.png

     

     

     

     

     

    2.png
    1.png
    3.png

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 645

#2
Vish WR Profile Picture

Vish WR 234

#3
Haque Profile Picture

Haque 211

Last 30 days Overall leaderboard