What is Microsoft Power Fx? An easy 10 minute Guide
Power FX has been around for longer than you think. Since Canvas Apps were first introduced in 2016, it has been possible to create them using the in built expression language. Everyone creating them learned the language simply by investigating the functionality, referring to the Microsoft Documentation and the various YouTube channels, Courses and Blogs that sprung up on the back of it.
At that time Power Automate was called Flow, Power Virtual Agents didn’t exists and Power BI was still in it’s infancy.
What’s different now and why is it important?
The expression language now has been given a name, and the name is Power FX. This is important among other things because content will be a little easier to find, but also because of what it means for the plaform. The future of Power FX is that wherever there exists a part of the Power Platform that doesn’t already have a native language then Power FX will become the go-to language of choice.
What this fundamentally means is that learning this language will become essential to learning the Power Platform.
The video version of Events
If you’re into videos, as I am then you may wish to take a look at this as I’ll take you through the same guide, only you don’t have to do quite so much reading!
Closely Related to Excel
The structure of the way in which you work with functions in Power FX is very similar to the way in which you would work with excel. Let’s take a basic If statement in both languages.
Excel:- =IF(B3="Apples",1,2) Power Apps:- if(myDropdown.Selected.Value = "Apples",1,2)
As you can see from a structure perspective there is very little difference between the two of them. In the first instance in Excel we look at cell B3 and if it contains the word “Apples” then we will return a 1, otherwise it’s a 2.
In PowerApps, we’re doing something similar, only we are looking at the selected item in a dropdown. In this case if it reads “Apples” then a 1 is returned, otherwise a 2 will be returned.
As well as the above the ideas around working with text is very similar
Excel:- ="Hello " & "World" returns Hello World Power FX "Hello " & "World" returns Hello World
If you look for the functions around text they are almost identical.
No compiling required
There are lots of reasons why Excel is successful, and one of them is because there is no “compile” operation. You enter the formula and then you get an immediate response. Power FX is the same, and this is great as if you make a mistake you get to find out about it straight away.
In the case of Power FX you’ll also have the ability to navigate directly to the error that you’ve made.
The concept of declarative Logic and no compiling are closely linked – when you want to find out why an object is of a certain color, or has a particular piece of text showing all you need to do is to go to the object itself, find the relevant property and this will tell you.
It is the Imperative Logic in Power Apps and Power FX that really makes it special – essentially this means that we can click on a button and tell it to do something. Examples of Imperative functions are:-
- Navigate – to move between screens
- Reset – to reset a control
- Refresh – to refresh a data source
- Collect – to push data into an in memory table
- SubmitForm – to submit a form
- Patch – to send data to a data source
The dot notation allows us to navigate through the properties of an object. This could be as simple as
Which returns to us a color property, which we might want to use elsewhere. But we can extract many many propertties from our objects, and these depend on the object themselves.
Here are some more examples
- Gallery1.Selected – returns an entire record
- Gallery1.Selected.Title – returns the value in the Title field
- TextBox1.Text – returns the text entered into a text box, and this is important as if we wish to make use of it in a patch statement to create a new record then this is the expression that we would need.
Coming to the Power Platform
This is the really BIG news. Power FX won’t be residing only in Power Apps for much longer and the intention of Microsoft is for it to fill areas of the Power Platform where the language is less well developed. At this stage we’re aware that it will be coming to :-
- Dynamics/Dataverse calculated columns
- Power Virtual Agents
- Power Automate
Other languages remain
There are other languages in the Power Platform ecosystem and these are likely to remain as they are. These are
- DAX – Data Analysis Expressions used in Power BI
- M, or Power Query – Used for Extract Transform and Load activities
How to Learn More
Aside from going through Microsoft Documentation, the Microsoft Announcement and the various YouTube channels you can dive into this free course. If you already know Power Apps that just fine – you can head to the Module on Objects, or Functions. Roughly 150 of the 200 demos build from blank and have a Power FX element to them.
So what’s next?
We’re now in the watch this space moment and we’ll get more details on how this will roll out. I would expect that the programme in total will be measured in years, however we may see some changes inthe coming months. Overall the message is this – If you want to be successful with the Power Platform then Power FX needs to be in your kitbag.