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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Global Bot Variable to...
Copilot Studio
Answered

Global Bot Variable to be set in another topic?

(0) ShareShare
ReportReport
Posted on by 40

I have a global variable called postcode that I have set in one topic.

In another topic I wish to ask for a postcode, I was hoping to reuse the global variable again so that regardless of topic when I set a users postcode then we will have the postcode set for the duration of their session with the bot.

 

Is this possible?

I have the same question (0)
  • Verified answer
    CU22081450-0 Profile Picture
    Most Valuable Professional on at

    Hi @AdamHunt ,

     

    Today, you just can reuse the global variable but you can't update that.

    A bot variable's name must be unique across all topics. In the case of a conflict, you'll need to rename the variable before saving your change.

    https://docs.microsoft.com/en-us/power-virtual-agents/authoring-variables-bot#set-bot-variables

  • AdamHunt Profile Picture
    40 on at

    Thanks for confirming that for me, from a user experience its quite unhelpful as we end up asking the same question in different topics potentially.

  • Egbert Profile Picture
    33 on at

    Better to think of them as global, immutable, constants. The content or value is not variable.

    I agree, it's a miss - leads to all sorts of logic gymnastics and duplication of topics to work around it.

  • MisterBates Profile Picture
    39 on at

    There is a way to set and reuse a global variable ... create a topic that has a single question like "what is your postcode" that stores the entered value in a global variable. From the topics where you want to use the postcode, simply refer to the global variable - if it's set already, you'll get the value it's set to; if it's not set, the user will be asked "what is your postcode" (using the topic with the single question) and you'll be able to use the result in your other topics.


    Seems that global variables are "immutable" once set, but by isolating the "set the global value" in a single question topic, you can refer to the global value elsewhere without worrying about whether it's been set or not.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 251 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 201 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 93 Moderator

Last 30 days Overall leaderboard