| Hafsa Farooqui
Add Custom Commands to Command Bar using Command Designer
(In model-driven app)
Power Apps provided the option to add custom commands to the command bar. This dramatically lowers the barrier for developing model-driven apps because now anyone can customize the command bar. The best thing is that the only coding language you need to be familiar with is Power FX, which is the same language used to make canvas apps.
To add a custom command on the command bar, you have to follow these steps:
- Create a new model-driven app
- Select the table on which you want to add command, then select three dots (…) and select “Edit command bar”
- Choose the command bar you want to edit. There are four command bar locations:
- Main Grid
- This command bar is displayed when you open an app and where you can see the view of a table.
- Main Form
- This command bar is displayed on the main form of the table.
- Subgrid View
- This command bar is displayed on the sub grid of another table.
- Associated View
- This command bar is displayed on the form of a parent table when viewing related data in this table.
Then select “Edit’
- To create a new command, Select “New”, then “Command”
- Select the component library
We will use Power FX for now.
- On the right-side select the properties for the button and enter its Label and Action that this button will perform, Select Icon, Set Visibility and Order number.
- In Action, Choose “Run Formula” and enter the Power FX formula
- Select “Save and Publish”, then “Play”
- The custom command will be shown on main form and button will open a new form
Join us next time, as we continue our journey of learning canvas apps.Click here to learn more about Imperium's Power Apps Services. We hope this information was useful, and we look forward to sharing more insights into the Power Platform world.