How many types of variables are there in power apps?

In Power Apps, different types of variables are essential components that store and manage data efficiently. These variable types play a vital role in app development, impacting how information is stored, accessed, and manipulated. Understanding these various types of variables is crucial for streamlining your app-building process

There are three types of variables in power apps.

Local variable

A local variable is a single row variable that lives exclusively on a single screen. As a result, you won’t be able to use this variable across your Power Apps.

The syntax for local variable:

UpdateContext({mSupplierSaveButton:"Update"});

Here mSupplierSaveButton is the variable name and “Update” is the variable value.

Global variable

Global variable is a single row variable that exists throughout all of your Power Apps and may be used on any screen.

The syntax for global variables:

Set(varShowDeletePopup,true);

Here varShowDeletePopup is the variable name and its value is true.

Collections

Collections are variables containing numerous rows of values. They can be viewed as arrays or tables. You may use collections in all of your Power Apps.

The syntax for Collections:

Collect(

    ProductList,

    {

        Product: ProductName.Text,

       Color: Colors.Selected.Value

    }

)


Here ProductList is the collection name and having two columns which are Product and Color.

Leave a Reply

Your email address will not be published. Required fields are marked *