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 / Power Apps / Change Header colour i...
Power Apps
Suggested Answer

Change Header colour in Environment

(3) ShareShare
ReportReport
Posted on by 33
Is it possible to change the header color from the standard purple depending on which environment you are in , within  power platform?  I would like to have different ones for Dev/Prod/Test it just helps to make if obvious.  TIA
I have the same question (0)
  • vipuljain03 Profile Picture
    657 Super User 2025 Season 2 on at
    Approach-1:
    By using environment variables & Param, you can achieve this scenario.
     
    You can set the header color in the App.OnStart property and check the environment and set the header color based on Param value.
     
    Below is a sample code:
    Set(
        varHeaderColor,
        If(
            IsBlank(Param("HeaderColor")), // Check if Param is blank (i.e. running in editor)
            "#808080", // Default gray color for editor
            Param("HeaderColor")
        )
        // For Production:
        // EnvironmentVariable.HeaderColor
    );
     
    Approach-2:
    I change the App Name/Title based on environment. So if user open UAT app, it will show App_Name-UAT etc.
     
  • DBNL Profile Picture
    33 on at
    Thanks for  your response .  However I  don't think I explained myself properly. It's not the app header it's the actual environment header.  TIA
  • TP18 Profile Picture
    182 on at
    Hello,
     
    You will have to do it from Microsoft 365 Administration Page -> Customize the theme for your organization - Microsoft 365 admin | Microsoft Learn
     
    Thanks

    Like my answer? - Hit that Thumbs Up. Resolved the Issue? - Hit Accept as Solution.

    This helps others find solutions to future issues!
  • Suggested answer
    Ravi-Prajapati Profile Picture
    416 Super User 2025 Season 2 on at

    Yes! You can dynamically change the header color in Power Apps based on the environment (Dev, Test, Prod). Here’s how you can do it:


    Method 1: Using Environment() Function (Recommended)

    The Environment() function retrieves the current environment name, which you can use to set a different color for each environment.

    Steps:

    1. Go to App > OnStart and define a variable:

      Set(varEnv, Environment().Name);
    2. Set the Fill property of the header (or app background) to:

      Switch(
      varEnv,
      "Dev", RGBA(255, 165, 0, 1), // Orange for Dev
      "Test", RGBA(0, 123, 255, 1), // Blue for Test
      "Prod", RGBA(220, 20, 60, 1), // Red for Prod
      RGBA(128, 0, 128, 1) // Default Purple
      )
      • Change "Dev", "Test", and "Prod" to match your environment names.

    Method 2: Using a Custom Table (If You Need More Control)

    If Environment().Name doesn’t match your expectations, you can create a Settings Table in Dataverse with:

    • EnvironmentName (e.g., Dev, Test, Prod)
    • HeaderColor (e.g., #FFA500 for orange)

    Then, onappstart, use LookUp() to fetch the right color:

    Set(varHeaderColor, LookUp(Settings, EnvironmentName = Environment().Name, HeaderColor));

    Then set the header’s Fill property:

    ColorValue(varHeaderColor)

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 > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard