Skip to content

Object Array Converter

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.

ParameterTypeRequiredDescription
modestringNoConversion mode for objects: values (values only) or entries (key-value pairs). Default entries.
toObjectBystringNoConversion mode for arrays: index (uses numeric index as key) or key (uses an object property as key).
keyFieldstringNoWhen toObjectBy is key, name of the object property to use as key.
continueOnErrorbooleanNoIf true, continues the flow even if there are errors. Default true.
{
"nextModule": "siguiente_modulo",
"data": {
"0": { "id": 1, "name": "Item A" },
"1": { "id": 2, "name": "Item B" }
}
}

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 entries mode returns an array of [key, value] pairs
  • The values mode returns an array with only the object values
  • objectToArray (object to array conversion with more modes)
  • dataset (generate data in the desired format)
  • dataTransform (transform data structure)