Skip to content
aeropage-round-dark
Aeropage Documentation
Queries and Filters

icon picker
Queries Guide

Fetch data from external sources to use on the page.

What are queries?

Queries are used to connect to cards, components, and data sources. A query defines a way to fetch data, similar to an airtable view. It’s not an actual data source, or part of a component. It’s a separate object that exists by itself.

Key points
The records in queries can be displayed in repeating components.
When inside a repeating group (Cards etc) you can access new groups in the variable manager.
Specific records (Active, Next, Previous, First, Last) can be accessed directly in the variable manager.
The same query can be connected to multiple components.
When components are duplicated, the query they reference is not duplicated.
Each query has one active record, by default this is the first record in the response.


Managing Queries

You can see a list of the queries in a page from the query manager, or when choosing a data source for a repeating component.

Rename

You can rename queries, to differentiate queries that use the same data source but behave differently.

Untitled.png

Fetching from Airtable Views*

Airtable has an excellent view system where you can apply custom sorting and powerful filters. When setting up your data sources, you can connect multiple views from the same table - by doing so you can filter your data externally.

Open the View
Sometimes, filters applied externally can accidentally be applied and cause Aeropage to not recieve the response you may expect. In this case it’s useful to open the view directly from the interface and make sure all the records are visible then resync the data just to make sure the cache is updated.

Untitled 1.png

Syncronizing Data
To improve performance and reduce API calls, we use caching. If you change your Airtable view you will need to open the data manager, and click the sync button to see the changes.

Untitled 2.png

Hourly Cache
When a record enters or leaves a view because of a date filter, API will not detect the changes and the new records in will not automatically appear. To fix this you can make the query use an hourly cache. It’s less efficient but more accurate.

Untitled 3.png

blunt-bulb
To make date filters in your Airtable Views work properly, switch the query to hourly cache.


Types of Queries

There are three broad groups of queries, based on the type of data they are accessing the filter options will be different.

External Data

When querying an external data source such as a database, an API call will be made. Typically these are used for larger data sets with the most extensive options for filtering.

Connections

The most common query type, just querying an external data source directly.

Untitled 4.png

Dynamic Pages

Dynamic page queries behave just like connections, but instead of choosing the data source, you choose a dynamic page. The query will use whichever data source that dynamic page is using.

Untitled 5.png

Related Pages

Related pages are used as a query when two dynamic pages are directly linked in the page tree - and there is a relationship between their tables - you can define that relationship as dynamic filter in the path.

Learn about

Nested Queries *

Inside repeating groups such as Cards, you can access an additional level of data from linked fields. These work at the component level by selecting the data source for a component.

Untitled 6.png

Records order

Query API Results Ordering:

View-Based Fetching: When records are fetched via a view, they are returned in the order defined by that view.
Table-Based Fetching: When records are fetched directly from a table without a specified view, the order is arbitrary.

Linked Records:

Dynamic Filters: The order can vary depending on how the query is constructed, particularly with linked records.
Linked Relationships:
• Fetching records with a filter like “fetch cities where city is linked to country” returns the records in the order applied to the Airtable view.
• Fetching records with a query like “fetch (array of countries) from linked field (cities)” returns records in the order they appear in the linked field.

Pages

You can query the pages in your project using predefined filters - most commonly you can fetch the list of public pages or portals and connect them to a repeating text or button to create navigation elements such as menus.

Untitled 7.png

Local Data

You can also query local data sources - blocks within the page, selections made by the user from cards, or custom data sources you created in the editor.

Untitled 8.png

Block Lists

A block list can be used to make navigation components within the page (or for a single-page-application) with the block name, icon and order coming directly from your page setup. It's a great option for portals and dashboards with alot of content. The default block list will contain any blocks you add to the block list.

Default Block List *
A default block list will be added automatically to all pages, you can add blocks to it by right clicking on the block.

Untitled 9.png

megaphone
You do not need to create the default block list, it exists on every page automatically.

Record Lists

For every external query, an empty record list will be created to store the array created with actions. You can use any repeating method (most commonly cards) - and the is selected condition for determining if a record is in a selection. After building the record list, it can be displayed using this type of query.

Untitled 10.png

megaphone
Add records to the record list using the action.

Record List Array / Variables *
As well as being a repeating data source with multiple records you can loop through, the local data is accessible as a single array value that can be modified using actions, sent in forms or applied to other queries as filters.

Untitled 11.png

megaphone
Record lists are also accessible as variables, where the value is the array of ids.

Custom List

For situations where you want a small amount of custom data to be used in repeaters on your page - just create a custom list. It has basic content options like text, images and icons and is useful for making custom selection options in forms and filters.

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.