Note on how to see where Power Apps variables are defined and used.
Power Apps Variables
Frankly, the readability of Power Apps source code is low, so I sometimes lose track of where global and context variables are “declared and used”.
This article shows how to check where variables are declared and used.
How to check with the latest Power Apps Studio
The latest Power Apps Studio is much easier to use, and you can see all the variables in the app from the “Variables” icon on the left side.
For example, if you open the Global Variables item, you will see that the following two variables are declared and used in the application,
- glbVar2 : Declared by Button3.OnSelect in Screen0
- glbVar : Declaration in App.OnStart
and if you open the Context Variables item, you will see that one variable each is used in Screen0 and Screen1.
Furthermore, since the “search” function is now available, it is possible to search for variables all at once like this if the variable naming conventions have been properly decided.
A replace function is also provided, so you can change the name of a variable at once when you “want to modify the name of a variable.
When you take over an application from another developer, you will probably first check to see what variables are being used, so this feature is very useful in such cases.
Related Articles
Click here to learn more about the use of variables such as global variables and context variables.
How I Handle Variables in Power Apps: My Tips for Set, UpdateContext, and With.
I'm often asked about the use of different variables in the Power Apps canvas application, so I'll note the use I make o...
Extra: How to find variables in the old Power Apps Studio
As an added bonus, here’s how to find variables in the old Power Apps Studio. If you can look at it from a nostalgic perspective, such as.
First, select “File” from the File menu
and open the “Variables” tab.
Then you can see where the global variables and the context variables for each screen are declared.
Also, by opening the “Definition” tab, you can see where the variables are used.
コメント