by compare key

This block is part of the array group and was last modified in core v13.0.8.

by compare key v13.0.8

Merge array increment by deep key

In pins 5
  • base array required
    array

    array to merge into

  • from array required
    array

    array to merge from

  • deep key
    value

    the key to be merged, if none given, the main array wil be merged

  • compare key required
    value

    the keys to be compared, based on the comparision, these objects are merged

  • increment keys
    array

    Keys to increment, within the array being merged. For example quantity

Out pins 1
  • merged array
    array

Merges base_array then merge_from into one array deduplicated on the string value of compare_key: the first occurrence is kept and later occurrences shallow-merge over it, their fields overwriting, EXCEPT the increment_keys fields which are summed numerically. With deep_key set, items are drawn from the array at that path inside each element. Non-array base outputs [] plus error BASE_ARRAY_IS_INVALID; empty compare_key outputs [] plus MISSING_COMPARE_KEY.

merge increment deep key
merge deep

A typical wiring for by compare key: with values feeds the base_array pin; with values feeds the merge_from pin; value feeds the compare_key pin; the merged_array out pin feeds length.

Studio canvas example for the by compare key block: typical wiring for by compare key.

Version history

Introduced in v13.0.8.


Back to array Return to the main group to view all sub-groups Back to merge Return to the group to view all blocks within this group