In Power apps there is two types of variables.
- Local variable
- Global variables
- Local variables
Local variable will be available with in the screen, it will not available outside the screen/ in another screen.
To declare a variable we have to use below syntax, we can use same code to update the existing variable
updatecontext({variablename:value})
To declare multiple variables at a time
updatecontext({Variable1:Value [,Variable2:Value [Variable3:Value [....]]]}
2. Global variable
Global variable will be available with in Context of the application, it will be available in all the screens.
To declare global variable we have to use below syntax. we can use same code to update the existing variable
Set(VariableName, Value)