Berserk Docs
Tabular OperatorsOther Operators

invoke

Invokes a tabular function with the piped input as the first (tabular) argument.

Syntax

invoke function_name(args)

Call a user-defined function with the input table as first parameter

Parameters

NameDescription
function_nameName of the tabular function to invoke
argsAdditional arguments (excluding the implicit tabular parameter)

Examples

Example 1 — Add a bonus to each warrior's plunder using a reusable function

let add_plunder = (T:(warrior:string,silver:long), bonus: long) {
  T
  | extend total = silver + bonus
};
datatable(warrior:string, silver:long)[
  "Ragnar", 500,
  "Bjorn", 300
]
| invoke add_plunder(100)
warrior (string)silver (long)total (long)
Bjorn300400
Ragnar500600

On this page