Hide command button on Create record Form Model Driven App - PowerFX
Model-Driven App
Jan 23, 2024 2:00 PM

Hide command button on Create record Form Model Driven App - PowerFX

by HubSite 365 about Softchief Learn

Learn how to take advantage of your business data with Microsoft Dynamics 365 & Power Platform & Cross Technologies. My name is Sanjaya Prakash Pradhan and I am a Microsoft Certified Trainer (MCT) and

Citizen DeveloperModel-Driven AppLearning Selection

Join this channel to get access to perks: https://www.youtube.com/channel/UCx28J1vtdIZId2ztVgFiJPQ/join This video explains the below points on Dynamics 365 Cus

Using PowerFX to hide or show command buttons in Model Driven Apps is a recent development in Microsoft Power Apps. PowerFX, being a low-code formula language, simplifies the process and makes it accessible even for those without extensive programming knowledge. Here's a step-by-step guide on how to use PowerFX for this purpose:

  1. Open Power Apps Studio from make.powerapps.com.
  2. Navigate to 'Solutions' and open the solution containing your desired table/entity.
  3. Within the solution, open a Model-Driven App of your choice.
  4. Select an entity/table, click on more, and choose “Edit Command Bar”.
  5. Choose the area where you want to place the command button (Main grid, Main form, Subgrid view, or Associated view).
  6. In the command button editor, click on “New” to add a new button on the form’s command bar.
  7. Provide a name to your button, navigate to the “Visibility” property, and select “Show on conditional from formula”.
  8. Insert the Power FX formula in the "Visibility" property to define the conditions for hiding and displaying the button. For example, if you want to hide a command button when a form’s field “SRL” is less than 2 and show it otherwise, use the formula: If(Self.Selected.Item.SRL < 2, false, true).
  9. Save and publish the changes once completed.
  10. Validate the functionality in the Model-Driven App to ensure the button hides and shows as expected.

This process allows you to dynamically control the visibility of command buttons in Model-Driven Apps using PowerFX formulas, thereby offering a more streamlined and efficient way to customize app interfaces【11†source】.

Another useful feature of PowerFX in Model-Driven Apps is the ability to create visibility rules for different scenarios. For instance, you can set up rules to show or hide a command in a list view, hide a command during record creation, or show a command based on specific record data. These rules use PowerFX formulas to evaluate conditions and determine the visibility of commands【10†source】. This flexible approach empowers app makers to create more intuitive and responsive app interfaces that cater to specific user needs and scenarios.

Summary: PowerFX for Command Button Visibility in Model-Driven Apps

Model-Driven Apps in Power Apps now support using PowerFX to dynamically control the visibility of command buttons. This feature enables app makers to create custom visibility rules based on specific conditions, enhancing the user experience and interface customization of Model-Driven Apps. PowerFX, with its Excel-like formula structure, makes this functionality accessible even to those with minimal coding experience.