Regions - List
)Cities - List
)Cities - Detail
)Cities in Region
)Cities in Region
), we'll leverage Airtable's formulas, by filtering the data in the Cities table according to the region name.Copy Base
to duplicate to your account.
Includes two tables (Cities and Regions), with a linked record to bind each city with their region.
👉https://airtable.com/shryIgvyyYqdGZWGwCreate New Collection
and use the Airtable wizard. This will generate two sample requests (list and detail) per table, so 4 requests in total.Regions - List
.data.records[].fields.region
with the variable name region_name
, as we'll use this variable later in the Cities in Region request (see screenshot below).Cities - List
Cities - Detail
**Cities in Region
** ${region_name}
, which we defined in the Regions - List request.%2C
in the URL is an encoded comma, the formula in plain text would be search('${region_name}',arrayjoin(region_name))
. You can use this Airtable API encoder to generate the URL.search
and arrayjoin
are being used. With search
, we specify first a string to search (in this case, we're using the ${region_name}
variable we defined in the Regions - List request), and then the term where we want to search. This will be obtained by executing another formula, arrayjoin
, over the column named region_name in our Cities table (note that it has the same name as the previously mentioned variable).arrayjoin
is that the region_name field consists of an array with a single element, which is the name of the region we mentioned before (this is the way the Airtable API returns the lookup fields).filterByFormula
parameter, we'll be able to link a screen listing all the regions, bound to the Regions - List request, with a screen listing all the cities that belong to the region we clicked in the previous screen. This last screen will be bound to the Cities in Region request..data.records[].id
. Then, under Selected Data, change the Name of the data path .data.records[].id
to ID
, so it matches the ID variable in the Cities - Detail request.