Variables are a fundamental part of any development approach, regardless of whether you are using PowerApps or you are developing using a programming language. They are used to store temporary copies of data so that they can be consumed by other areas of your app.
All variables are defined by boundaries from which they can be accessed; that is, we can create variables that can only be accessed within a single screen or that can be accessed throughout the app. This is known as scope.
Global variables
Global variables are scoped so that they can be accessed from anywhere within your app. Global variables are extremely versatile as you can store any type of data within it; that is, you can store tables of data as well as simple strings and numbers.
To define a global variable, we use the Set function and provide it with the variable name and value. In the following example, I will create a global variable called varMyVariable and assign it a string value of My Global Variable:
...