Skip to content
aeropage-round-dark
Aeropage Documentation
Pages & Content

icon picker
Variables Guide

Learn how to use or manipulate data in the page.
Variables simply placeholders for values - and are used everywhere to reference dynamic values from your database (backend), in the page (frontend) or from the project and the user environment. You can also create custom variables within the page and use actions to update variables based on events that happen while a user is interacting with your page. Below are some examples of how variables are used.

Untitled.png

How to use Variables...


Display on Page
The most common use of variables is just to display them in the page by mapping their values into components, text, images etc. You can do this within almost any component. The variable manager will appear whenever a field accepts variables.

Filter Queries
You can use variables in filters to make them dynamic, either based on some properties of the logged in user, the page they are viewing - or within the page by changing the variables with actions.

Send in Forms
You can use variables to extend form functionality by creating new variables from existing ones and passing variables (rather than user inputs) in form submissions.

Condition / State
Apply conditions that reference variables using the logical conditions group. Now you can use actions to change the variables, which will alter the state and in turn, change the appearance or functions of components, dynamically adjust filters, etc.
Whenever possible, the variable manager will appear to allow you to insert dynamic values into the editor. You can also open the variable manager from the top controls.

Untitled 1.png

Local Variables

In any page you can create and store custom variables, either in the page itself temporarily, or in a session or cookie so that you can use the variables in other pages during the user session or until the cookie expires.

Untitled 2.png

Custom

You can create custom variables to store values in the page, as the result of actions. When creating a custom variable, you will need to define a type. A single value can be stored as text or numbers, or you can create an array to store multiple values. To modify arrays you should run a function, whereas single values can be set using the set a variable action.

Untitled 3.png

Inputs

The values from input components can be accessed from the local data → . They can be used to create custom forms, displayed directly in the page, referenced by conditions - or passed into queries as filters.

URL Parameters

You can pass values from the URL into the page and use them to display or reference in condtions.
Untitled 4.png

Content Data

This group of variables lets you reference content (blocks, frames, components) relative to the current location.

info
Only visible when accessing variables from inside components and actions.

In this view we have opened the variable manager from an action, applied to a button. The values of these variables will be relative to the button itself and its parents (frame and block). In the case of previous and next - these will reference the neighboring elements.

image.png
image.png
This type of data is almost always used with the action.

Loading…

Data / Query Variables


Default Fields*
You will see some variables colored purple above the main section. These are default variables that are mapped to specific fields in a data source. They should be used wherever possible, so that your dynamic values remain working even if the data source changes.

Untitled 5.png

Card / Table / Component Records

When working inside the scope of a repeating group (Cards, Table) or a component connected to its own data source - you can access the fields from the data source.

Untitled 6.png

Active Records

For each query, by default the first record will be designated as the active record and its field values can be referenced using the active record variable group. When an action is fired to change which record is active, all the active record variables will update automatically.

megaphone
You can also access records adjacent to the active record (next / previous) or first / last of the array.

Untitled 7.png

Rollups

You can access various types of roll-up (calculated) values from all the records in a given query / for a specific field. This is very useful for combining all the linked records in a field into a single array, or calculating the total value of the records in a shopping cart.

IDs - will provide a single array of all record ids in a query response.
Join - will combine all the arrays into a single array.
Sum - will calculate the total of all the records for any number field.
Count - will calculate the total number of unique occurrences of values.

Untitled 8.png


Dynamic Pages

Each dynamic page in the path is connected to a record, which will be fetched when the page loads. All the field values for each dynamic page in the path will be available under a section of the variable manager, labelled with the record name.

Untitled 9.png

blunt-bulb
You can access all dynamic pages in the path, not only the current page.

User and Account


Account Variables

In all pages you can reference the default values for the account and user groups the current user is logged into.

Untitled 10.png

User Record

In portals, and pages in the same branch as a portal - you can access the entire user record and all fields stored in the user group’s data source.

Untitled 11.png


megaphone
Learn more in the chapter for


Global Variables

Your project can also have custom variables that are loaded into all pages, or you can access values from the environment / browser.

Untitled 12.png

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.