Object Array Converter
Description
Section titled “Description”This module converts data between object and array formats bidirectionally. It automatically detects whether the input is an object or an array and applies the corresponding conversion. For objects, it can extract values (values), key-value entries (entries), or both. For arrays, it can convert to object using numeric indices (index) or a specific property as key (key). It is useful when a downstream module requires a different data format than what the upstream module produces.
Configuration
Section titled “Configuration”Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| mode | string | No | Conversion mode for objects: values (values only) or entries (key-value pairs). Default entries. |
| toObjectBy | string | No | Conversion mode for arrays: index (uses numeric index as key) or key (uses an object property as key). |
| keyField | string | No | When toObjectBy is key, name of the object property to use as key. |
| continueOnError | boolean | No | If true, continues the flow even if there are errors. Default true. |
Output
Section titled “Output”{ "nextModule": "siguiente_modulo", "data": { "0": { "id": 1, "name": "Item A" }, "1": { "id": 2, "name": "Item B" } }}Usage Example
Section titled “Usage Example”Basic case
Section titled “Basic case”Convert object to array of values:
{ "mode": "values"}Convert array to object by property:
{ "toObjectBy": "key", "keyField": "id"}- Input type detection is automatic (object vs array)
- If the input is neither object nor array (e.g.: string, number), it returns an error
- For array to object conversion with
toObjectBy: "key", if an element doesn’t have the indicated property, it is skipped - The
entriesmode returns an array of[key, value]pairs - The
valuesmode returns an array with only the object values
Related Nodes
Section titled “Related Nodes”- objectToArray (object to array conversion with more modes)
- dataset (generate data in the desired format)
- dataTransform (transform data structure)