Key Use Cases for Variables
Types of Variables
SAP Build Apps includes different types of variables for various purposes.
Types of Variables
| Type | Purpose |
|---|
| App Variable | It is used to store the information that needs to be accessible throughout the app. |
| Page Variable | It is used to store the information that needs to be accessible only for the current page. |
| Page Parameter | It is used to store the information that is required to open the current page. For example, if you have a product details page that displays information about the current product, the page requires an ID for the product to display its data. |
| Data Variable | It is used to store the information retrieved from an external data resource. A data variable can be configured to either store a single record or a list of records. |
Page parameters and data variables have specific use cases, but app variables and page variables essentially store data. You may wonder when you use one or the other.
You could store all your data in app variables, but all app variables are displayed together, and you might have so many that it would be difficult to keep track of your long list of app variables.
It would be easy for you–and anyone helping you develop your app–to store the data you need for individual pages in those pages and not lump them together as app variables. This way, each page could manage its own page variables, and you would better know the purpose of each variable.
Define Variables
The default state of a page is the User Interface, which shows the layout of the page with all its components. If you want to define variables, choose the tabVariables.
Here you will find a place to define the different types of variables. Choose the type and then choose ADD APP VARIABLE to start defining a variable.