Home › Power Apps / Custom Pages / Dataverse / Power Fx › Using Power Fx in a Model-Driven App Command Bar Button
Power Apps / Custom Pages / Dataverse / Power Fx · Jul 26, 2022 · 1 MIN READ

Using Power Fx in a Model-Driven App Command Bar Button

In this post, we will look at how to use Power Fx in a model-driven app button.

First, let’s go over to the Power Apps Maker portal at https://make.powerapps.com and select Edit:

This takes us to the app designer, and from here we can select an entity such as the Account and then Edit the Command Bar:

We are now prompted to select which command bar to edit. The choices are below (note the graphic changes when you select an option so you can see what you are changing):

  • Main grid
  • Main form

  • Subgrid view

  • Associated view

Let’s select the main form, and click Edit. We see the buttons available on the form:

Let’s click on New and select Command:

We now have the option to use Power Fx or JavaScript. Let’s go with Power Fx. Note the Learn more link takes you here:

Our new command is placed on the page:

Let’s change the label to Run Power Fx (you would name yours something more useful) and we will open the formula bar:

This places us in the formula bar:

Let’s run the Power Fx command Notify, which displays a message in the notification bar at the top of the form:

Now let’s Save and Publish, then Play. You may need to refresh after pressing Play:

We get the notification:

 

Carl de Souza
Keep learning. Keep building.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.

Subscribe on YouTube →
Carl de Souza Enterprise Architect at Microsoft · AI Technology Expert

2 Responses to Using Power Fx in a Model-Driven App Command Bar Button

  1. Hi, how do I run a flow from the OnSelect of the button? Some examples will help please. I’ve created an instant flow and I need that to run when I press the button.

    Thanks

  2. Hi Carl,

    Your articles are so helpful and set out with easy-to-follow explanations thank you!

    I have the same question as Iakshhari. Is there an easy way to run a flow on selection of a button?

Leave a Reply

Your email address will not be published. Required fields are marked *

Carl de Souza
KEEP LEARNING. KEEP BUILDING.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.