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 / How to create a chat b...
Copilot Studio
Answered

How to create a chat bot global variable without having to ask a question

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all, 

I am having to declare a global variable that I am updating in bot framework composer. For the time being, it looks like this is only possible through asking a question. I don't exactly need the question ,is there a workaround for this? 

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

    Take a look at this demo:

    https://powervirtualagents.microsoft.com/en-us/blog/reusing-variables-across-topics-and-setting-variable-values-from-external-sources/

     

    Even though you are authoring it as if it is a question, the question will be skipped if the variable exists.

  • Faten Yahiaoui Profile Picture
    Microsoft Employee on at

    @peterswimm thanks for your response. Having looked through the link you have provided,it looks like you're setting the value for the variable in the html code from which the bot is summoned. I am currently testing my power virtual agent using the online emulator in PVA and I am setting the value in Bot Framework Composer framework as follows

    fatenyahiaoui_0-1654589732521.png

    I am not sure if your recommendation will fit the current setting that I have. 

     

     

  • Faten Yahiaoui Profile Picture
    Microsoft Employee on at

    Quick update, I found a solution for my problem. 

    I basically created a PVA topic meant specifically to create global variables. 

    I made sure that the question I created was not a multiple choice question because if it was the case my bot would throw an error if the value I am setting in composer is different than the listed options. 

    fatenyahiaoui_1-1654593059508.png

    For reference, the error it threw when I originally created the above as a multiple choice question is the following : 

    " we ran into a problem executing your composer dialog. cannot convert variable new_variable_991b6a78ca314cd7a8ecd409f1469824_1f67feefb28646919345212afad7ca80 to a namedentity".

     

    PVA automatically skipped the question when I had my global variable set in composer as follows : 

    fatenyahiaoui_2-1654593283671.png

    When the above was removed and I tried invoking this in my topic as an input to power automate, then PVA would prompt the user for an answer : 

    fatenyahiaoui_3-1654593342643.png

    This is working now, and I hope this clarifies it for other people trying to implement the same.

    Best

    Faten

     

     

     

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!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 445

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 123 Super User 2026 Season 1

#3
chiaraalina Profile Picture

chiaraalina 59 Super User 2026 Season 1

Last 30 days Overall leaderboard