$multiply

$multiply operator lets you multiply multiple values and return the result of the expression. You can use this in any Expression Object.

Syntax

{
    "$multiply": [ <expr>, <expr>, ... ]
}

Properties

FieldDescriptionRequired

<expr>

The <expr> expression can be any valid expression as long as it resolves to a number.

It can also be a Magical Autocomplete.

true

Returns

float - The result of $multiply operation

Examples

Basic example

{
    "$multiply": [10, 2, 3]
}

The above expression returns 60.0

With Nested Expressions

{
    "$multiply": [
        {
            "$multiply": [1, 2]
        },
        3,
        4
    ]
}

The above expression calculates the nested expression, return 2 in its place and then the outer $multiply expression returns 24 overall.

With Magical Autocomplete

Let's say we have declared a variable temp in our API flow, which has a value of 5 currently.

{
    "$multiply": ["$.variables.temp", 3]
}

The above expression would resolve to a result of 15.0

Last updated