Variable
  • 22 Jan 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Variable

  • Dark
    Light
  • PDF

Article Summary

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:

  1. On the Workspace tab of your company, in the Projects folder, select the needed project and stage, double-click Variables, and then click Create.
    Create%20variable

  2. In the Create variable dialog:

    1. In the Title field, enter your variable title.
    2. In the Value type list, select RAW or JSON.
    3. In the Value field, enter the needed value or click the code editor icon Code%20editor%20icon and enter the value in the Code editor dialog that opens.
      Note: You can link a Process later when editing the alias.
    4. Click Ok.

    Create%20variable%20dialog

The variable has been created, and you can use it in your Processes.

Variable%20created

Manage variable

To see what additional actions you can perform on your variable, click the needed variable.

Variable%20selected

Now you can:

  • Check the variable information, by clicking the info icon Info icon.
    Variable%20info

  • Delete the variable, by clicking the options icon Options icon_2 , and then clicking Delete.
    Delete%20variable

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.
    cert no var request.gif

  • Signing a request with a certificate by using a variable.
    cert with var request.gif

  • Using the Sign the request with the secret key feature to store a secret key and sign the requests you send with it:

    1. Create an API key and call it Key.
    2. 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"
           }
    }
    
    1. Save the variable with the secret key part.

    2. 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"
                }
        ]
         }
      
    3. In Other, select the Sign the request with the secret key checkbox.

    4. 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.

    5. In the upper-left corner of the page, click Deploy to save the changes.

    6. 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.

creds with var.png

For more information, go to Start.


Was this article helpful?

What's Next