doc-burger

What are Page and App Variables in Peaka?

A look into the differences between page variables and app variables in Peaka

Understanding Page and App Variables

In Peaka, variables play a crucial role in storing and managing data for your applications. This article will explain the concepts of Page Variables and App Variables and how they differ.

Accessing Variables

To access variables in Peaka, click on the "Variables" button located at the top of the page, as shown in the image below:

open variables modal button view

Variable Properties

A variable in Peaka has three main properties:

  1. Name: This is a unique identifier for the variable.
  2. Type: It defines the data type of the variable (e.g., text, number, boolean).
  3. Value: The value represents the actual data stored in the variable.

Peaka lets you change the value of a variable either in the variable panel or through flow actions, providing flexibility in how you manage your data, as depicted in the image below:

app variables modal view

Page Variables

Page Variables are specific to the page where they are created. They offer localized storage for data that is relevant only to that particular page. Page Variables are ideal for situations where you need to maintain data within the scope of a single page.

App Variables

In contrast, App Variables are accessible from every page in your Peaka project. They provide a global storage space for data that needs to be shared across multiple pages. App Variables are valuable for scenarios where you require data consistency and continuity across your entire application.

Conclusion

Page Variables and App Variables are essential tools for managing data within your Peaka applications. By understanding their differences and use cases, you can make informed decisions about how to structure and store data effectively in your projects.