multiply by field

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

multiply by field v13.0.8

Returns an array with each item multiplied for the provided key

In pins 5
  • Array required
    array

    The array to be multiplied

  • multiply key required
    value

    A key within each object in the array to be multiplied

  • multiply by key required
    value

    A key within each object in the array to multiply by • Hidden when other fields are filled

  • new field key
    value

    The key to set the new multiplied field on, if empty it will be set on the multiple key

  • multiply by required
    number

    The amount this key should be multiplied by • Hidden when other fields are filled

Out pins 1
  • output
    array

    All items with or without multiplied values

For each object item, multiplies the number at multiply_key (missing or non-numeric reads as 0) by the value at multiply_other_key when set, otherwise by multiply_by, writing the product to new_field_key or, when that is empty, OVERWRITING multiply_key - items are mutated in place; non-object items pass through. multiply_by equal to 0 counts as unset: with no multiply_other_key the block emits error MISSING_MULTIPLY_BY and no output array.

A typical wiring for multiply by field: with values feeds the multiply_array pin; value feeds the multiply_key pin; value feeds the multiply_other_key pin; number feeds the multiply_by pin; the output_array out pin feeds length.

Studio canvas example for the multiply by field block: typical wiring for multiply by field.

Version history

Introduced in v13.0.8.


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