Skip to main content

Notifications

Copilot Studio - Bot Extensibility
Answered

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

(0) ShareShare
ReportReport
Posted on by

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:
  • Re: How to create a chat bot global variable without having to ask a question

    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

     

     

     

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

    @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. 

     

     

  • Verified answer
    peterswimm Profile Picture
    peterswimm on at
    Re: How to create a chat bot global variable without having to ask a question

    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.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard

Featured topics