Skip to content

Script

Script (script)

Calculated fields.

Transform Scripting json

Minimal example

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

Contents

Fields

FieldTypeRequiredDescription
description Generalstringdescribe this step.
condition Generallua-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()
overwrite Outputboolean (bool)Overwrite a field if it already exists.
let Scriptmap (string)field-expression pairs, evaluated sequentially after the optional run snippet; each expression sees fields created earlier in the list.
load Runtimepath (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
run Scriptmultiline-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.

General

Show fields
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

Show fields
FieldTypeRequiredDescription
overwriteboolean (bool)Overwrite a field if it already exists.

Script

Show fields
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.

Runtime

Show fields
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

Schema

Let Table

FieldExpression
event.fieldvalue + 1

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