{Step by Step} Apply Patch Function from command using Power FX via new command editor

In continuation of my previous articles where we were exploring how to use the new Command designer, today we will learn how to apply a more complicated Patch function via Power Fx Command.

You can refer the previous parts as listed below:

Part 1: How to create a button:

Part 2: How to apply a Power FX command using Command

Part 3:Apply Show Hide rules using Power FX command

In this blog, we will learn about the Patch function of Power FX in PowerApps, and we will use it in button click using the brand-new command editor!

Today’s requirement is that the account name should be updated at the click of a button.

To implement this requirement, first we need create a command button for which you should refer to Part 1 mentioned above.

We have created a button named as “Patch.”

And, we have used this formula to implement our requirements and added the formula for the notification:

Patch(Accounts, Self.Selected.Item, {‘Account Name’: “Patched: ” & Self.Selected.Item.’Account Name’});Notify(“Acount name is Upadated successfully”)

Let us test this button now! 

As you can see the account name is updated on the click of the Patch button.

Hope it helps! 

Power 365ing as usual! 

Any requirements, implementation or consulting work in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual? 

Problem Area – Technical, Functional, Training, Development or consulting? 

Me and my team are here to assist, please fill the following form for your business needs: Click here 

About the Author: 

{Step by Step} Add Show/Hide visibility rule using Power Fx to a Command button using new Command designer

In continuation of my previous articles where we were exploring how to use the new Command designer, today we will learn how to apply show and hide rule using Power Fx in the new command designer.

Part 1: How to create a button:

{Step by Step}Create Command button in Power Apps using command designer

Part 2: How to apply a Power FX command using Command designer: https://dynamicsofdynamicscrm.com/2022/08/04/step-by-stepadd-power-fx-commands-on-a-command-button-using-command-designer/

In last article we had already created a button named as “Entity Details.”

Now let us apply show and hide rule to the button!

Formula

Select the button “Entity Details”, click On Visible property and apply below formulae:          If(CountRows(Self.Selected.AllItems) > 0,true , false)

Based on this formulae, if at least one row of data is selected, button will be visible. Else, it will be invisible.

Please refer screenshot below:

As seen in below screenshot, command button is visible only when at least one contact is selected:

Tip: Sometimes the change on button does not reflect instantaneously, so you might need to refresh the page two to three times!

Now let us see the button visibility when no contact is selected:

Hope it helps!

Power 365ing as usual!

Any problem in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual?

Problem Area – Technical, Functional, Training, Development or consulting?

Me and my team are here to assist, please fill the following form for your business needs: Click here

About the Author:

{Step by Step}Add Power Fx Commands on a command button using command designer

In the last post we learnt how to add a command button using command designer: https://dynamicsofdynamicscrm.com/2022/07/27/step-by-stepcreate-command-button-in-power-apps-using-command-designer/

In this post, we will explore various Power FX commands we can add using new command designer:

We will cover the formulas “Navigate”,” URL” and “Notify”.

First go to the site map for Account table and click in the three dots ,click on edit command bar. Thereafter select the Main grid.

Three buttons are created as per reference in my last blog.

On click of “Navigate Active Record” button, we will navigate to “My Active Accounts” view

  • Formula for Navigate.

Navigate(‘Accounts (Views)’.’My Active Accounts’)

  • Result:

Now let us try to click on Navigate Active Records on Inactive Accounts view:

You can see that on click of the button we have navigated to “My Active Accounts” view:

Formula for URL:

Launch(“https://dynamicsofdynamicscrm.com/”);

Formula for Notify:

On click of Notification command button, we will try out Notify command:

Notify(“YouSelected”&Self.Selected.Item.’AccountName’,If(CountRows(Self.Selected.AllItems) > 0,true,false))

  • Outcome:

There is a show hide formulae also applied on this button(about which we will learn in my next article). The button will only be visible on selection of particular record:

On selecting a single account named “A.Datum dd” and clicking on the “Notification” button, you can see above that the name of the record is showing in the notification section.

Hope it helps!

Power 365ing as usual!

Any problem in Power Platform or Dynamics 365 – end user, Microsoft partner or an individual?

Problem Area – Technical, Functional, Training, Development or consulting?

Me and my team are here to assist, please fill the following form for your business needs: Click here

About the Author: