Flight Tags
FLIGHT TAGS
A Flight Tags section allows to configure flight tags.
Except colours and names, it is possible now to define conditions under which a tag is automatically assigned to a flight.
Creating conditions
To create a condition, click on the row in the “Conditions” column. The condition can be based on the data listed in the “Available fields” section.
Once the condition is saved, its details will appear in the general view within the tag configuration window.
TQL — Tags Query Language
TQL (Tags Query Language) allows you to define conditions for automatically adding a Flight Tag to a flight leg. When a flight is created or modified, Leon evaluates the TQL condition and automatically adds the tag if the condition is true, or removes it if false.
TQL is configured per tag in Settings → System → Flight Tags by clicking the Edit TQL button.
Syntax
TQL is based on Symfony Expression Language. The condition always has access to one variable: flight, which represents the current flight leg.
Available fields
The following fields can be used in TQL conditions:
Field | Type | Description | Example values |
|---|---|---|---|
| string | Flight number |
|
| string or null | Aircraft registration |
|
| string or null | Aircraft type name |
|
| string | Departure airport ICAO code |
|
| string | Departure airport IATA code |
|
| string or null | Departure airport country name |
|
| string | Destination airport ICAO code |
|
| string | Destination airport IATA code |
|
| string or null | Destination airport country name |
|
| string | Trip type (see values below) |
|
| string | ICAO flight type (see values below) |
|
| string | Flight rules (see values below) |
|
| integer | Flight distance in nautical miles |
|
| string | AOC label assigned to the flight |
|
tripType values
Value |
|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
icaoType values
Value | Meaning |
|---|---|
| Scheduled |
| Non-scheduled |
| General aviation |
| Military |
| Other |
rules values
Value | Meaning |
|---|---|
| IFR |
| VFR |
| IFR then VFR |
| VFR then IFR |
Operators
Operator | Description | Example |
|---|---|---|
| Equal |
|
| Not equal |
|
| Value is in array |
|
| Value is not in array |
|
| Logical AND |
|
| Logical OR |
|
| Logical NOT |
|
| Numeric comparison (use for |
|
| Regex match |
|
Examples
Tag all owner flights:
flight.tripType == 'OWNER'Tag flights operated by a specific aircraft:
flight.aircraft.registration in ['A-BCDE', 'D-LEON']Tag non-training and non-simulator flights:
flight.tripType not in ['TRAINING', 'SIMULATOR']Tag IFR flights departing from Poland with distance over 500 NM:
flight.rules == 'I' and flight.adep.country == 'Poland' and flight.distance > 500Tag flights to or from Germany:
flight.adep.country == 'Germany' or flight.ades.country == 'Germany'Tag scheduled commercial flights:
flight.icaoType == 'S' and flight.tripType == 'REGULAR_PAX_TRANSPORT'Tag flights from specific airports (using ICAO):
flight.adep.icao in ['EPWA', 'EPWR', 'EPKK']Notes
String values are case-sensitive. Use the exact values listed above (e.g.,
'OWNER'not'owner').Fields that can be
null(e.g.,flight.aircraft.registration,flight.adep.country) will benullif the data is not available. Use!= nullchecks when needed.The Available fields panel in the Edit TQL dialog shows the actual data of the most recent flight, which helps in writing accurate conditions.
If the condition field is left empty, the tag will not be automatically added or removed.