Restructure Lists of Signals

If you have a list of signals that you want to condense into fewer signals or even one signal, there are a few nio Blocks that will help. The Join block is commonly used and supports signal grouping.


Paring down lists of signals with the Join block

The Join block goes through every signal in an incoming list and consolidates them into a single signal based on the specified criteria. For example, if you have your signal with the numbers 1 through 5 from the previous example, you can shrink the list of five signals into one signal containing two attributes—one for odds and one for evens.

{
  "name": "Split Odds and Evens",
  "type": "Join",
  "key": "{{ $num % 2 }}",
  "value": "{{ $num }}"
}

This configuration (based on the configuration of key) will create a new signal with two attributes.

{
  0: [2, 4],
  1: [1, 3, 5]
}

results matching ""

    No results matching ""