Manage variables
Unlock the complete study guide + 1,040 practice questions across 16 full exams.
Bundled into the existing Designing and Building Integrated AI Agent Solutions in Copilot Studio premium course — no separate purchase.
14-day money-back guarantee — no questions asked.
Included in this chapter:
- Four scopes, and what each one is for
- Base types and the assignment that fixes them
- Referring to a variable in a Power Fx formula
- System variables: context you should not recollect
- Declaring a topic's input and output parameters
- Where control returns after a redirect
- Clearing session state on purpose
- Letting an external source set a global variable
- Consuming environment variables inside an agent
- Topic checker and the orphaned variable
- How these choices show up in questions
The four variable scopes, compared on the properties that decide which one to use
| Property | Topic variable | Global variable | System variable | Environment variable |
|---|---|---|---|---|
| Where you can use it | Only the topic that creates it (the default scope) | Every topic in the agent | Every topic in the agent | Every topic in the agent |
| Who sets the value | Nodes in its own topic, or a caller through an input parameter | Any topic, and an external source when the variable declares one | Copilot Studio, from the conversation and the signed-in user | An administrator or maker in Power Apps; read-only in Copilot Studio |
| Where it is defined | A node in the topic, or the Variables panel | A topic variable switched to Global (any topic can access) | Built in to every agent | A Power Platform solution |
| Power Fx prefix | Topic. | Global. | System. | Environment. |
| What it is for | Working state inside one piece of authored logic | Session state several topics share | Conversation and user context you should never recollect | Configuration that differs between environments |
Decision tree
Cheat sheet
Unlock with Premium — includes all practice exams and the complete study guide.
Also tested in
References
- Variables overview - Microsoft Copilot Studio
- Work with global variables - Microsoft Copilot Studio
- Understand error codes - Copilot Studio troubleshooting
- Work with variables - Microsoft Copilot Studio
- Create expressions using Power Fx - Microsoft Copilot Studio
- Manage topic inputs and outputs - Microsoft Copilot Studio
- Orchestrate agent behavior with generative AI - Microsoft Copilot Studio
- Manage topics - Microsoft Copilot Studio
- Use system topics - Microsoft Copilot Studio
- Use environment variables in Power Platform solutions - Power Apps