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 / Hide model driven app ...
Power Apps
Answered

Hide model driven app command bar button based on environment variable value

(1) ShareShare
ReportReport
Posted on by 54

I created a new button with the new command designer. I would like to make this new button visible/invisible based on an environment variable value. 
It's possible to set the visibility using Power FX based on some conditions:

 

selimdag_0-1652109110218.png

 

selimdag_1-1652109177375.png

But I couldn't find a way to get the value of the environment variable value using Power FX. 

Can anyone help me with that? 

PS: I'm also open to other approaches.

 

 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    meelamri Profile Picture
    468 on at

    Hi, 

     

    You need to add two additional tables: Environment Variable Values and Environment Variable Definitions. To do this, you need to open the component library: 

    melamri_0-1652113535331.png

    Then you can the two tables (Environment Variable Values and Environment Variable Definitions): 

    melamri_1-1652113698690.png

    Also in the component library. You can now use a powerFx expression for the visibility of the button depending on the value of your environment variable. In my case, the environment variable is "mea_BtnVisibilityEV"

    melamri_2-1652113795759.png

    You will need to save and publish your component, like a canvas app component. Then, close everything and reopen the command designer, the visibility expression will now be inherited from the command library: 

     

    melamri_3-1652114116442.png

     

    It works in my environment (y)

     

    Please tick Accept as solution if the answer is useful.

    https://xrmtricks.com/

     

     




  • CU20011233-0 Profile Picture
    54 on at

    Hi @melamri

    that works pretty fine. Thanks a lot! 

  • RobMolenaar Profile Picture
    112 on at

    This was really helpful thanks!

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 321 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 289 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 200 Super User 2026 Season 1

Last 30 days Overall leaderboard