Skip to main content

core.transform.apply

Apply a Python lambda function to a value.

Inputs

python_lambda
string
required
Python lambda function as a string (e.g. "lambda x: x.get('name')").
value
any
required
Value to apply the lambda function to.

Examples

Filter, transform, and compact

core.transform.filter

Filter a collection using a Python lambda function.

Inputs

items
array[any]
required
Items to filter.
python_lambda
string
required
Filter condition as a Python lambda expression (e.g. "lambda x: x > 2").

Examples

Filter, transform, and compact

core.transform.map

Map a Python lambda function to each item in a list.

Inputs

items
array[any]
required
Items to map the lambda function to.
python_lambda
string
required
Python lambda function as a string (e.g. "lambda x: x.get('name')").

Examples

Filter, transform, and compact

core.transform.drop_nulls

Remove null values from a list.

Inputs

items
array[any]
required
List of items to filter.

Examples

Filter, transform, and compact

core.transform.is_in

Filters items in a list based on whether they are in a collection.

Inputs

collection
array[any]
required
Collection of hashable items to check against.
items
array[any]
required
Items to filter.
python_lambda
string | null
Python lambda applied to each item before checking membership (e.g. "lambda x: x.get('name')"). Similar to key in the Python sorted function.Default: null.

Examples

Keep or exclude matching items

core.transform.not_in

Filters items in a list based on whether they are not in a collection.

Inputs

collection
array[any]
required
Collection of hashable items to check against.
items
array[any]
required
Items to filter.
python_lambda
string | null
Python lambda applied to each item before checking membership (e.g. "lambda x: x.get('name')"). Similar to key in the Python sorted function.Default: null.

Examples

Keep or exclude matching items

core.transform.deduplicate

Deduplicate a JSON object or a list of JSON objects given a list of keys. Returns a list of deduplicated JSON objects.

Inputs

items
object | array[object]
required
JSON object or list of JSON objects to deduplicate.
keys
array[string]
required
List of JSONPath keys to deduplicate by. Supports dot notation for nested keys (e.g. ['user.id']).
expire_seconds
integer
Time to live for the deduplicated items in seconds. Defaults to 1 hour.Default: 3600.
persist
boolean
Whether to persist deduplicated items across calls. If True, deduplicates across calls. If False, deduplicates within the current call only.Default: true.

Examples

Deduplicate by a stable key

core.transform.is_duplicate

Check if a JSON object was recently seen.

Inputs

item
object
required
JSON object to check.
keys
array[string]
required
List of JSONPath keys to check.
expire_seconds
integer
Time to live for the deduplicated items in seconds. Defaults to 1 hour.Default: 3600.

Examples

Deduplicate by a stable key

core.transform.flatten_json

Flatten a JSON object into a single level of fields.

Inputs

json
string | object
required
JSON object to flatten.

Examples

Flatten and query JSON

FAQ

Expressions support Tracecat literals, operators, and FN.* helper functions. Python lambda functions are not part of the expression language, so they must be passed as strings to actions such as core.transform.apply, core.transform.filter, or core.transform.map.Use FN.* for short inline transforms, and use core.transform.* when you need Python-style per-item logic.
Add a small debug reshape step first. This lets you confirm whether you have a list or object, inspect a count, and verify the field path you plan to iterate over.

core.transform.eval_jsonpaths

Eval multiple JSONPath expressions on an object.

Inputs

json
string | object
required
JSON object to eval JSONPath expressions on.
jsonpaths
array[string]
required
JSONPath expressions to eval.

Examples

Flatten and query JSON