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 / Unable to access envir...
Copilot Studio
Suggested Answer

Unable to access environment variables in an agent

(1) ShareShare
ReportReport
Posted on by 10
Hi,
 
I have created a string environment variable to store a storage account name in my solution in Power Apps. I have an agent in the same solution where I want to access the environment variable. But I do not see the variable under the Environment or System variables section. I have tried to remove and readd the variable to the solution and try this in incognito browser. 
 
What am I missing?
 
Thanks,
Nihar Dalai.
Categories:
I have the same question (0)
  • Prasad-MSFT Profile Picture
    Microsoft Employee on at
    Why You Don’t See the Environment Variable
    • Environment variables created in Power Apps solutions are not always immediately available to Copilot Studio agents or flows.
    • Sometimes, there is a delay in propagation, or the variable is not surfaced in the Copilot Studio UI.
    • Only environment variables of type “Environment variable (string)” and set to “Current Value” are accessible at runtime.
    • If the variable is not referenced in a flow or app, it may not appear in the variable picker.
    What to Do
    Check Variable Type and Value
    • Ensure the variable is of type “Environment variable (string).”
    • Set a “Current Value” (not just a default value).
    Publish All Customizations
    • In Power Apps, go to your solution and “Publish all customizations.”
    Refresh Copilot Studio
    • Wait a few minutes, then refresh Copilot Studio (or try a new browser/incognito window).
    Reference in a Flow
    • If you still don’t see it, try referencing the environment variable in a Power Automate flow in the same solution. Sometimes this “activates” the variable for other components.
    Check Permissions
    • Make sure you have the right permissions in the environment.
  • Suggested answer
    Valantis Profile Picture
    4,793 on at
     
    Environment variables in Copilot Studio don't appear automatically in the Environment/System variables section until you reference them inside a topic. That's likely why you don't see it.
     
    Here's how to access it:
    1. Open a topic in your agent
    2. Add a Set variable value node or any node that uses variables
    3. Open the variable picker and look for the Environment section  your variable should appear there
    4. Once referenced in a topic, it shows up in the Variables panel on the right side
     
    A few things from Microsoft docs to check:
     
    Environment variables are read-only in Copilot Studio you can read them but not modify them from within the agent. Make sure you have a Current Value set on the variable in Power Apps (not just a Default Value). Default Value alone is not always used at runtime.
     
    Also confirm the environment variable is in the same solution as your agent. If it's in a different solution, it may appear in the picker but won't reliably deploy to target environments.
     
    After making any changes to the environment variable value, you need to republish the agent for the new value to take effect at runtime.
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

     
  • CU29041745-1 Profile Picture
    10 on at
    Thank you both for your response. I have tried all the below and still no luck.
     
    1. I have confirmed it is a text environment variable with both a default value and a current value.
    2. It is in the same environment and solution as my agent.
    3. I have published all customizations after creating the variable.
    4. Waited a few mins and tried to access environment variables in an incognito browser.
    5. Tried accessing it in the Greeting topic of the agent as below. Dont see it.
     
     
    6. I can see the environment variable as a parameter in a flow. Tried using it there. Came back to the topic and still dont see it.
     
    Any thoughts what might still be missing?
     
    Thanks,
    Nihar Dalai.

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 704

#2
Vish WR Profile Picture

Vish WR 249

#3
Haque Profile Picture

Haque 244

Last 30 days Overall leaderboard