Skip to content

Get Variable ​

Get Variable block on the canvas

The Get Variable block reads a value that you saved earlier with Set Variable (or in JS code) and passes it to the next block.

When to use it ​

  • Bring back a value from earlier in the flow, like the user you looked up ten blocks ago.
  • Use a value in a block that has no JS field of its own.
  • Don't use it inside JS fields, where the name is already available. Write total instead of adding a Get Variable block.
  • Don't use it to read settings or secrets. Use App Config.

Inputs ​

FieldRequiredDefaultWhat it does
ModeNoSingleSingle handles one value. Multiple handles a list of rows, see below.
KeyYesnoneThe name of the variable to read, exactly as you named it.

Outputs ​

HandleWhen it is used
Next (right)Always. The next block receives the variable's value.

Example ​

An earlier step ran Set Variable with Key total and Value 120. Later, after other blocks changed the flowing data:

FieldValue
Keytotal

The next block receives 120 as its input.

Single or Multiple ​

Pick Multiple to read several variables in one block. Each row has a Key.

  • The output is an array with one value per row, in row order.
  • A variable that was never set gives undefined for its row. The other rows still work.

With rows price and total, the next block receives [10, 20].

How it behaves ​

  • A missing variable is undefined. If nothing was saved under that name yet, it is not an error. The next block just gets no value, so check it with an If Condition when it matters.
  • Names must match exactly. Total and total are different variables.
  • It replaces the flowing data. The next block's input is the variable's value, not what came before.
  • Only this request. Variables don't carry over from one request to the next.
  • Saved outputs are separate. Blocks with Save output to variable write to outputs.<name>. Read them as outputs.<name> in JS, or get the whole outputs object with this block using the key outputs.

Released under the Apache License 2.0. Enterprise features are under the Fluxify Enterprise Edition License.