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 / Model Driven App - Com...
Power Apps
Unanswered

Model Driven App - Command buttons are visible in new environment despite visible is set to false

(1) ShareShare
ReportReport
Posted on by 48

Dear all,
I’m encountering a frustrating issue with Command Buttons visibility in Model-Driven Apps.
The command buttons that I have created using command bar editor are hidden when certain criteria are met, using Power FX formula for visibility and that works perfectly in the Developer environment. It also works as expected in two environments where I have imported the solution as managed. For example:

Milosh_0-1712419595937.png

Milosh_1-1712419885211.png

 

However, in two environments where I have imported the solution as unmanaged, the command buttons are always visible regardless of formula being correct and same as in original solution. I have also tried to put explicit false to Visible parameter (without formula) but the result is the same.

Milosh_3-1712420109279.png

 

Milosh_4-1712420679513.png

Note that when I click on any of the buttons they perform perfectly (they call proper JavaScript functions).

These are the things that I have tried until now:
- Creating new button, making it hidden (IsVisble = false) – same result
- Opening component library, checking if formulas are the same, refreshed data sources, making changes there and saving them.
- Regenerating Ribbon Metadata using Command Checker.
- Publish all customizations from classic Editor.

I would appreciate any idea how to solve this problem.
Regards,
Milos

Categories:
I have the same question (0)
  • Anil_g Profile Picture
    668 Moderator on at

    @Milosh 

     

    Two causes that you can check

     

    1. Is there any script you have written which is overwriting the visible property to true even if it is hardcoded to false

    2. Might not be the case but try to clear the cache and check if the issue persists

     

    cheers

  • Milosh Profile Picture
    48 on at

    Thank you @Anil_g for your prompt suggestions.

    1. I don't have such scripts. I also added TestButton that has no action and the results are the same

    2. I've already tried on several different machines and in InCognito/InPrivate modes. No luck.

     

    Regards,

    Milos

  • Static Profile Picture
    118 on at

    Hi @Milosh 
    I had the same issue before. I didnt find any solution except use Workbench Ribbon and from the with rule and JS I solved this issue. and now I no longer use the command panel. Workbench only. it's much more reliable.
    https://www.develop1.net/public/rwb/ribbonworkbench.aspx

  • billwinder Profile Picture
    4 on at

    Did you find a solution to this Milosh, we have encountered similar issue in last few days and wondering if Microsoft update has affected command bars?

  • Milosh Profile Picture
    48 on at

    Hi @billwinder ,
    Not 100%, but it worked for some environments. 
    Here is a brief description of the process that is done in the environment where command buttons are always visible:
    1. Default Component Library (that is used for buttons) -> Make a change for one button (Visible from expression to false)
    2. Save and then Publish the Component Library
    3. Publish all customization
    4. Select App -> Edit -> Select View or Form where your buttons are. Create additional button. 
    5. Publish all customization.
    6. Import again the solution (that you originally used) and publish all customization after.

    However, I haven't found the cause and still looking. It is clear that is MS bug, because enable rules for command buttons are not loaded properly. 

    Milosh_0-1713518122579.png

     


    As it can be seen from the screenshot above Enable Rule -> ExpressionRule returns error and because of that it will return true for visibility since that is the default value. 

  • billwinder Profile Picture
    4 on at

    Thanks for the response @Milosh .  After raising this with Microsoft, they have put in a fix for this in our environment, so hopefully they have for you also.

    They then advised us to do the following:

    1. Republish the component library.
    2. Clear the cache.
    3. Re-check the visibility of the buttons and let me know if the issue persists or not.
  • ruigameiro11 Profile Picture
    2 on at

    Hi @Milosh @billwinder 


    I'm having the same trouble with button visibility. In my buttons I use the function RecordInfo(Self.Selected.Item,RecordInfo.DeletePermission) to distinguish between two types of profiles with different permissions and it worked for a really long time. However, its visibility stopped working recently claiming there's a syntax error when I use "Self.Selected.Item" as a record argument:

    error.PNG

     

    I have checked command checker for this button and Enable Rule -> ExpressionRule returns error, as well. I haven't contacted Microsoft about this but I'm hoping you have some thoughts on this.

  • Suggested answer
    CU26080440-0 Profile Picture
    2 on at
    Hi @ruigameiro11,
      
    We've also faced a similar issue while setting a visibility rule for our custom Command button using Power FX, where the rule is based on user's permission of the record. In our situation, the visibility rule still worked but an error would show up in the designer. The fix was to tinker with the Power FX formula to explicitly specify the data source, such as:
    If(RecordInfo(
            First(Filter(Accounts, Account = Self.Selected.Item.Account)), 
            RecordInfo.EditPermission), 
        true, false)

    Hope this helps!
  • AM-04120800-0 Profile Picture
    8 on at
    ChatGPT solved this exact issue for me.

    Parameter 1: PrimaryControl
    Parameter 2: SelectedControl

    Visibility: (Formula): true    -  also tried with just "Show" option, same result.

    Before fix:  button only appears when *no* people were selected.

    Fix:  
    Visibility: (Formula):
    // Always true, but references Self.Selected to mark it item-specific
    CountRows(Self.Selected.AllItems) >= 0
    After fix:  Works perfectly (in my case, always displays - change >= to 1 or 2 as desired)

    So either one of two things:  1)  This logic exactly worked as advertised, or 2) It just randomly started working after a few minutes / various refreshes (plausible).

     

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 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard