- Print
- DarkLight
- PDF
Overview
Variables are stage objects where you can store data and that you can use in API Call and Start nodes. Variables store data in the RAW and JSON formats.
Create variable
To create a variable:
On the Workspace tab of your company, in the Projects folder, select the needed project and stage, double-click Variables, and then click Create.
In the Create variable dialog:
- In the Title field, enter your variable title.
- In the Value type list, select RAW or JSON.
- In the Value field, enter the needed value or click the code editor icon and enter the value in the Code editor dialog that opens.
Note: You can link a Process later when editing the alias. - Click Ok.
The variable has been created, and you can use it in your Processes.
Manage variable
To see what additional actions you can perform on your variable, click the needed variable.
Now you can:
Check the variable information, by clicking the info icon .
Delete the variable, by clicking the options icon , and then clicking Delete.
Note: To perform an action on multiple variables, press Shift or Command on your keyboard, click the needed variables, and then click the needed icon.
Examples
Variable syntax:
- For getting data stored in the RAW and JSON formats in variables, use:
{{env_var[id]}} {{env_var[@shortname]}}
- For getting data stored in the JSON format in variables containing nested structures, use:
{{env_var[id].key}} {{env_var[id].key[1].param}}
Variables use:
Use of a variable to store a certificate and sign requests that you send to the API in the API Call node.
Signing a request with a certificate by using a variable.
Using the Sign the request with the secret key feature to store a secret key and sign the requests you send with it:
- Create an API key and call it Key.
- Create a variable, select the JSON value type, and insert the following construction (where secret is the value of the secret key.):
{ "key": { "param": "12312", "param2": "secret" } }
Save the variable with the secret key part.
Open the API Call node in the Edit mode and enter the request you want to use (with the actual conv_id and company_id parameter values from your environment):
{ "ops": [ { "type": "create", "conv_id": 0000000, "obj": "task", "action": "user", "data": { "code": 200 }, "ref": "test", "company_id": "i000000000" } ] }
In Other, select the Sign the request with the secret key checkbox.
In the field below, enter the {{env_var[@secret-key-part].key.param2}} construction to read the necessary data from the JSON array stored in the secret-key-part variable.
In the upper-left corner of the page, click Deploy to save the changes.
Your requests sent from the API Call node will be signed with the secret key stored in the key variable.
Use variables to establish more secure authorization in Start nodes and conceal basic authentication credentials. You can use a variable, for example the
webhook-var
, with the following constructions:- {{env_var[@webhook-var].user}} for the username field
- {{env_var[@webhook-var].pass}} for the user password field.
For more information, go to Start.