Microsoft Power FX Overview
Microsoft Power FX Overview
Article
03/22/2024
8 contributors
In this article
Think spreadsheet
Always live
Low code
No code
Show 3 more
Power Fx is the low-code language that will be used across Microsoft Power
Platform. It's a general-purpose, strong-typed, declarative, and functional
programming language.
Note
Microsoft Power Fx is the new name for the formula language for canvas apps in
Power Apps. This overview and associated articles are a work in progress as we
extract the language from canvas apps, integrate it with other Microsoft Power
Platform products, and make it available as open source. To learn more about and
experience the language today, start with Get started with formulas in canvas apps
in the Power Apps documentation and sign up for a free Power Apps trial.
In this article, we refer to makers when we describe a feature that might be used
at either end of the programming skill spectrum. We refer to the user as a
developer if the feature is more advanced and is likely beyond the scope of a
typical Excel user.
Power Fx binds objects together with declarative spreadsheet-like formulas. For
example, think of the Visible property of a UI control as a cell in an Excel
worksheet, with an associated formula that calculates its value based on the
properties of other controls. The formula logic recalculates the value
automatically, similar to how a spreadsheet does, which affects the visibility of
the control.
Also, Power Fx offers imperative logic when needed. Worksheets don't typically have
buttons that can submit changes to a database, but apps often do. The same
expression language is used for both declarative and imperative logic.
This article is an overview of the language and its design principles. To learn
more about Power Fx, see the following articles:
Data types
Operators and identifiers
Tables
Variables
Imperative logic
Global support
Expression grammar
YAML formula grammar
Think spreadsheet
What if you could build an app as easily as you build a worksheet in Excel?
These were the questions that inspired the creation of Power Apps and Power Fx.
Hundreds of millions of people create worksheets with Excel every day; let's bring
them app creation that's easy and uses Excel concepts that they already know. By
breaking Power Fx out of Power Apps, we're going to answer these questions for
building automation, or a virtual agent, or other domains.
All programming languages, including Power Fx, have expressions: a way to represent
a calculation over numbers, strings, or other data types. For example, mass *
acceleration in most languages expresses multiplication of mass and acceleration.
The result of an expression can be placed in a variable, used as an argument to a
procedure, or nested in a bigger expression.
Power Fx takes this a step further. An expression by itself says nothing about what
it's calculating. It's up to the maker to place it in a variable or pass it to a
function. In Power Fx, instead of only writing an expression that has no specific
meaning, you write a formula that binds the expression to an identifier. You write
force = mass * acceleration as a formula for calculating force. As mass or
acceleration changes, force is automatically updated to a new value. The expression
described a calculation, a formula gave that calculation a name and used it as a
recipe. This is why we refer to Power Fx as a formula language.
For example, this formula from Stack Overflow searches a string in reverse order.
In Excel, it looks like the following image.