Flight Tags

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.

Flight tag icon

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.

Tags 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

Field

Type

Description

Example values

flight.number

string

Flight number

'LX001'

flight.aircraft.registration

string or null

Aircraft registration

'D-LEON', 'A-BCDE'

flight.aircraft.type

string or null

Aircraft type name

'EMB-135BJ', 'B737'

flight.adep.icao

string

Departure airport ICAO code

'EPWA', 'EGLL'

flight.adep.iata

string

Departure airport IATA code

'WAW', 'LHR'

flight.adep.country

string or null

Departure airport country name

'Poland', 'United Kingdom'

flight.ades.icao

string

Destination airport ICAO code

'EPKK', 'LFPG'

flight.ades.iata

string

Destination airport IATA code

'KRK', 'CDG'

flight.ades.country

string or null

Destination airport country name

'France', 'Germany'

flight.tripType

string

Trip type (see values below)

'OWNER', 'TRAINING'

flight.icaoType

string

ICAO flight type (see values below)

'S', 'N'

flight.rules

string

Flight rules (see values below)

'I', 'V'

flight.distance

integer

Flight distance in nautical miles

500, 1200

flight.aoc

string

AOC label assigned to the flight

'AOC-EU'

tripType values

Value

Value

OWNER

OWNER_CHARTER

PAX

REGULAR_PAX_TRANSPORT

CARGO

TRAINING

SIMULATOR

TECHNICAL

AMBULANCE

MISSION

AIRCRAFT_REPOSITIONING

FREQUENT_FLYER

STATE

HEAD

OTHER

icaoType values

Value

Meaning

Value

Meaning

S

Scheduled

N

Non-scheduled

G

General aviation

M

Military

X

Other

rules values

Value

Meaning

Value

Meaning

I

IFR

V

VFR

Y

IFR then VFR

Z

VFR then IFR

Operators

Operator

Description

Example

Operator

Description

Example

==

Equal

flight.tripType == 'OWNER'

!=

Not equal

flight.tripType != 'TRAINING'

in

Value is in array

flight.tripType in ['OWNER', 'OWNER_CHARTER']

not in

Value is not in array

flight.tripType not in ['TRAINING', 'SIMULATOR']

and / &&

Logical AND

flight.rules == 'I' and flight.distance > 500

or / ||

Logical OR

flight.adep.country == 'Poland' or flight.ades.country == 'Poland'

not / !

Logical NOT

not (flight.tripType == 'TRAINING')

>, <, >=, <=

Numeric comparison (use for distance)

flight.distance > 1000

matches

Regex match

flight.number matches '/^LX/'

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 > 500

Tag 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 be null if the data is not available. Use != null checks 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.