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

  • SB-16041549-0 Profile Picture
    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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 309

#2
11manish Profile Picture

11manish 187

#3
chiaraalina Profile Picture

chiaraalina 101 Super User 2026 Season 1

Last 30 days Overall leaderboard