Basic Information

appmixer.utils.controls.CodeBlock

1.0.0

Public

Allows you to write JavaScript code to transform data. Executes the provided code when the component receives input.

Input Ports

in

FieldTypeDescription
Code textarea Write JavaScript code to transform data. Access input data via $data object (e.g., $data.value).

- No top-level return statements - the last expression is automatically returned.
- To use return, wrap in IIFE:
(function() { return $data.value * 2; })()
- To return JSON object, use JSON.stringify:
JSON.stringify({
  name: $data.name,
  isAdult: $data.age >= 18,
  email: $data.email.toLowerCase()
});

- Define your variables in the 'Variables' form below. Variables will be accessible in the code as $data.<variable name>.
Variables expression Provide the variables.

Output Ports

out

FieldTypeDescription
Result -

Full Metadata