Columnal Documentation: Table of Contents

optional functions

get optionalget optional orget optionals from list
get optional(optional value)inner value Type: For any types t(@apply Optional(t)) -> t

Gets the value from inside an optional value, if it is present. If the value is blank, gives an error. If you want to supply a value in this case, use get optional or(..).

ExamplesClick an example to insert it
get optional(Optional\Is(17))17
get optional(Optional\None)error
get optional or(optional value, default value)result Type: For any types t(@apply Optional(t), t) -> t

Gets the value from inside an optional value, if it is present. If the value is blank, returns the second parameter instead.

ExamplesClick an example to insert it
get optional or(Optional\Is(17), 12)17
get optional or(Optional\None, 12)12
get optionals from list(list of optionals)present values Type: For any types t([@apply Optional(t)]) -> [t]

Gets all the present values from the list of optionals, in the same order as the original list. All None items are discarded.

ExamplesClick an example to insert it
get optionals from list([Optional\Is(17), Optional\None, Optional\Is(42), Optional\None])[17, 42]
get optionals from list([Optional\None])[]