Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Writes key and value into myVault dictionary belonged to the workflow.

This method differs from myVault.set method in “saving into myVault is deferred” condition and will be executed on workflow complete event.

...

Please also see session.vault by this link

Please see conditionas for “Workflow complete“ by this link

...

Writes key and value into Global myVault dictionary belonged to the account.

This method differs from myVault.setGlobal method in “saving into Global myVault is deferred” condition and will be executed on workflow complete event.

...

Please also see session.vaultGlobal by this link

Please see conditionas for “Workflow complete“ by this link

...

Datasource is an array of block responses, which dependency is set for the block

Expand
titleExample #1
Code Block
//the block has dependencies with 2 blocks: employees and timepunches

let employees = Datasource[0];

let timepunches= Datasource[1];
Expand
titleExample #2
Code Block
// the block has a dependency with 1 block, which response is an array of objects with 3 properties:
 
// API_key, employees and timepunches

let employees = fx.getEntityFromSource(Datasource[0], “employees“, ["API_key"]);

let timepunches = fx.getEntityFromSource(Datasource[0], “timepunches“, ["API_key"]);

\uD83D\uDCCB Related articles

...

Table of Contents
minLevel3
maxLevel3
includesession.vault|session.vaultGlobal|session.vars

session.vault

session.vault is an object of keys-value pairs which was set by myVault.setOnComplete() method and which will be moved into myVault on workflow complete.

Expand
titleExample #1
Code Block
let key = 1;

let value = fx.utcNow();

session.vault[key] =value; // the same code with myVault.setOnComplete(key, value);
Expand
titleExample #2
Code Block
let value = fx.utcNow();

session.vault.abc =value; // the same code with myVault.setOnComplete('abc', value);
Note

Please note that overriding of session.vault is forbidden.

For example, you will not be able to set following:

session.vault = [];

session.vault = null;

session.vault = 5;

...

session.vaultGlobal is an object of keys-value pairs which was set by myVault.setGlobalOnComplete() method and which will be moved into Global myVault on workflow complete.

Expand
titleExample #1
Code Block
let key = 1;

let value = fx.utcNow();

session.vaultGlobal[key] =value; // the same code with myVault.setGlobalOnComplete(key, value);
Expand
titleExample #2
Code Block
let value = fx.utcNow();

session.vaultGlobal.abc =value; // the same code with myVault.setGlobalOnComplete('abc', value);
Note

Please note that overriding of session.vaultGlobal is forbidden.

For example, you will not be able to set following:

session.vaultGlobal = [];

session.vaultGlobal = null;

session.vaultGlobal = 5;

...

session.vars is an object which Canvas provides for keeping of global variables in workflow context, which are not included into block responses.

Expand
titleExample
Code Block
session.vars = {c: 1, str: 'abc'};

session.vars.obj = {id: 1, name: 'flower'};

session.vars.arr = [1,2,3,4,5];
Note

Please note that overriding of session.vars is forbidden.

For example, you will not be able to set following:

session.vars = [];

session.vars = null;

session.vars = 5;

...

Canvas provides just 1 method which can be used in block JS-code, it is getVariables().

getVariables()

Returns array of block variables. No parameters.

...