Skip to main content Skip to footer

Array To Object Documentation

Version: 2.0.5 
Retrieved: 2025-10-09 15:15:13


Array To Object

The module flattens an array into an object. For example for inserting into a database. You have to be able to identify name and value properties on the incoming array to be able to convert it into a object.

Settings

Name Requirements Purpose Default
Source property String 1-64 in length The property containing the array to convert data
Target property String 1-64 in length The property to write the object into data
Name property String 1-64 in length The property that contains the name  
Value property String 1-64 in length The property that contains the value  

Example

The sample assumes that the modules receives 2 messages each second.

# Settings:
Source property = data
Target property = data
Name property = name
Value property = value

# Incoming messages:
{
    'data':[
        {name:'machineId', value:4126334, time:'12:03:23'},
        {name:'temp', value: 34.7, time:'12:03:20'},
        {name:'rpm', value: 12700, time:'12:03:26'}
    ]
}

# Outgoing message 1:
{
  'data': {
      'machineId': 4126334,
      'temp': 34.7,
      'rpm': 12700
  }
}

Note that the additional properties (for example 'time' is ignored).