Skip to content

Script

Script (script)

Calculated fields.

Transform Scripting json

Minimal example

actions:
- script: {}
JSON
{
"actions": [
{
"script": {}
}
]
}

Contents

General

General
FieldTypeRequiredDescription
descriptionstringdescribe this step.
conditionlua-expression (string)Expression evaluated before anything else; when it returns false neither the optional run logic nor any let pairs execute for that event.
Examples: 2 * count()

Output

Output
FieldTypeRequiredDescription
overwriteboolean (bool)Overwrite a field if it already exists.
Default: false

Runtime

Runtime
FieldTypeRequiredDescription
loadpath (string)Load a file containing Lua functions into the current context ‘init.lua’ is loaded by default.
Examples: /path/to/file, c:\users\joe\data\file.txt

Script

Script
FieldTypeRequiredDescription
letmap (string)field-expression pairs, evaluated sequentially after the optional run snippet; each expression sees fields created earlier in the list.
runmultiline-text (string)Per-event logic executed after the condition passes but before the let pairs run; it can set up state but no longer short-circuits the lets.

Schema

Let Table

FieldExpression
event.fieldvalue + 1

Key format: field. Value format: lua-expression.