# Build Key List

This function builds a key-value list in a specified named variable. The keys and values are obtained from specified fields. Spaces are ignored before and after each key and value. The resultant list represents the merged keys and associated values from all selected files. Note that while the function is valid in all execution modes, it makes little sense when executing grouped.

Three delimiters are used:

- the delimiter separating keys from values. Default ≔ (\k))
- the delimiter separating key-value items. Default ⏎ (\~)
- the delimiter separating values. Default ➤ (\,)

You can optionally specify that keys and/or values are to be treated as case insensitive.

You can elect to keep or toss empty keys and/or values. If empty values are allowed, you can supply an optional string to represent the empty value.

The constructed list is the set of merged values found in the fields associated with the selected files or in a specified source named variable. When run in stepwise mode, the constructed list will contain every unique item. Empty elements are ignored. When determining uniqueness, alphabetic case will be ignored if the Case insensitive option is enabled. Spaces are ignored before and after each element.

An example of the usage of this statement is to produce a list of all unique artists per album.

The supplied strings may contain any of the escape sequences described in Escape Sequences. Note that regardless of the execution mode, the escaped strings are only evaluated once.

key-value lists are typically manipulated by the List Key statement.