transpose
This block is part of the array group and was last modified in core v10.4.28.
transpose v10.4.28 Transposes the given array of objects to an object with (key: sum).
- array required
arrayInput pin for the array of objects to be transposed.
- key required
valueInput pin for the key to use for the resulting object.
- sum-key required
valueInput pin for the key to use for summing the values in the array.
- object
objectOutput pin for the transposed object with (key: sum) format.
Builds an object from an array of objects: each item's value at the key path (stringified) becomes a property whose value accumulates the SUM of that item's sum_key values; a missing or non-numeric sum value adds 0. Items that are not objects or lack the key field are skipped. Example: [{k:a,v:1},{k:a,v:2}] with key k, sum-key v -> {a:3}.
A typical wiring for transpose: the object out pin feeds custom field.

Version history
Introduced in v10.4.28.
Back to
array Return to the main group to view all sub-groups Back to array Return to the group to view all blocks within this group
