web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : kKvq+R8PunIFOHmWFIOsvf
Power Apps - Power Apps Pro Dev & ISV
Suggested answer

Change Header colour in Environment

Like (3) ShareShare
ReportReport
Posted on 7 Feb 2025 09:16:20 by 31
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
    595 Super User 2025 Season 2 on 09 Feb 2025 at 13:13:24
    Change Header colour in Environment
    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
    31 on 10 Feb 2025 at 08:41:13
    Change Header colour in Environment
    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
    165 on 18 Feb 2025 at 10:41:31
    Change Header colour in Environment
    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
    414 Super User 2025 Season 2 on 18 Feb 2025 at 12:48:34
    Change Header colour in Environment

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 629 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 397 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 232 Moderator

Last 30 days Overall leaderboard
Loading complete