- Published on
Global Variables in PowerFx
- Authors
- Name
- Jason Deramo

PowerFx Blog©
Building Blocks of Code
My first post for the blog is to start with a really neat PowerFx function that is a game changer. Global variables enable you to temporarily hold a piece of information and reuse it for other parts of your app. Unlike context variables, which are scoped to a single screen, global variables are available throughout your app on all screens. These are the simplest kind of variables for most situations.
Setting Global Variables
Use the Set function to set the value of a global variable, which temporarily holds a piece of information, such as the number of times the user has selected a button or the result of a data operation.
Set(varGlobal, "Hello World!")
Global variables are implicitly created by using the Set function. No explicit declaration is required. If you remove all the Set functions for a global variable, that global variable will cease to exist. To clear a variable, set its value to the result of the Blank function.
Because global variables are always loaded, they increase the flexibility of your applications. — Shane Young, PowerApps911.com