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
| Name | Description |
|---|---|
| function_name | Name of the tabular function to invoke |
| args | Additional 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) |
|---|---|---|
| Bjorn | 300 | 400 |
| Ragnar | 500 | 600 |