1.

In PowerApps, how do you define or use a local or global variable?

Answer»

The Set FUNCTION is used to set the value of the global variable. This stores a piece of data momentarily, such as the outcome of operational data or the number of times a BUTTON has been pushed. The content variable is then created using the UpdateContext function, which temporarily stores information. CONTEXT variables (also known as LOCAL variables) are exclusively available on that screen; the value cannot be accessed from any other screen.

Syntax for local variable:

UpdateContext( { ContextVariable1: Value1 [, ContextVariable2: Value2 [, … ] ] } );

Example: 

UpdateContext( { Name: “ROSE”, Score: 10 } );

Syntax for global variable:

Set( VariableName, Value );

Example: 

Set( Counter, 1 );


Discussion

No Comment Found