Making a simple list of items is easy but is not always sufficient. In many cases, you would need to express a hierarchy by showing selectable lists of the items in each hierarchy level. Selection of any item shows that item's children in the next list. In order to create a cascaded list your data should be tree-shaped. The hierarchy of your data might be deep, and it might have many items on each level.
Let’s take a simple example of airports and countries. You want to build a simple app to keep a log of different flights reservations your company is making.
So in order to create a working cascaded list, you need to create two lists. First, a table of countries called “Countries”. Second, a table of Airports with a field type “linked list” linked with “Countries”.
This log is composed of the following fields:
- Name, text.
- Flying from – Countries, list of 227 countries.
- Flying from – Airports, list of 7940 airports worldwide.
- Date and time of Departure.
- Flying To – Countries, list of 227 countries.
- Flying To – Airports, list of 7940 airports worldwide.
- Date and time of Arrival.
- Status, fixed list (Confirmed, Canceled, Waiting List)
The list of airports is dependent on countries, if you are to chose the Netherlands for instance, a list 16 existing airports of the country should appear only.
Then in your reservation table, create one field type “linked list” linked with “Countries”. Now comes the fun part:
- Created a linked list field type and link it with “Airports”.
- Select the option “Cascaded”. Upon clicking on this option an addition dropdown list will appear.
- Choose the field name of the parent value.
- Click Save.
Now check how awesome this is by creating a new record as follow: