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 / Adding global variable...
Copilot Studio
Answered

Adding global variables into prompt tool

(0) ShareShare
ReportReport
Posted on by 16
Hi
 
I was wondering if there is a way to add a global variable into the prompt tool so I can use it as part of my prompt. So I can combine this with the input file from the user.
 
Thanks.
I have the same question (0)
  • Nivedipa-MSFT Profile Picture
    Microsoft Employee on at
    Hello ,

    There are two main ways to use “global” values in Copilot Studio prompts and combine them with user input, including files:

    1. Global (bot-scope) variables in Copilot Studio

    You can create variables with a global scope across all topics (bot-scope), which can be referenced in Message, Question, Generative answers, and Prompt action (AI Builder) nodes. This is useful for values like customer IDs, default parameters, or configuration flags that should be accessible throughout the agent.

    To set a variable as global (bot-scope):

    1. Create the variable, for example in a Question or Set variable value node.
    2. Go to Variable properties and set the scope to Global / Bot (any topic can access).
    3. The variable will appear with a prefix (e.g., bot.UserEmail) and can be added via the {x} variable picker in any node, including prompts.
      Work with global variables - Microsoft Copilot Studio | Microsoft Learn
      Work with variables - Microsoft Copilot Studio | Microsoft Learn

    Using global variables in prompts:

    2. Environment variables (Power Platform) for global configuration

    For “global values” that serve as ALM-friendly configuration (like API base URLs, keys, or model names), use Power Platform Environment Variables. Define these in a Solution via the Power Apps Maker portal, then reference them in Copilot Studio topics. This method keeps sensitive data out of the canvas and supports different values for each environment (Dev/UAT/Prod).

  • Verified answer
    S-Venkadesh Profile Picture
    1,214 Super User 2026 Season 1 on at
     
    Yes, you can use a global variable in a prompt across the agent.
    To demonstrate your scenario, use a global variable within the prompt. I’ve created two topics:
    1. Initialize
      • Create a global variable named VarLibraryName, Refer to Screenshot 1
    2. PromptDemo
      • Pass the global variable as a Text input to the prompt, Refer to Screenshot 2,3
     
    Screenshot 1:
     
    Screenshot 2:
     
    Screenshot 3:
     
    ✔️ If this answered your question, please click “Does this answer your question?” so it can help others in the community too.
    🩵 If it helped, please give it a Like!
    Best regards, 
    S. Venkadesh

     

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 599

#2
chiaraalina Profile Picture

chiaraalina 170 Super User 2026 Season 1

#3
deepakmehta13a Profile Picture

deepakmehta13a 118

Last 30 days Overall leaderboard