In OneCloud, variables take many different forms depending on where they are created and used. This guide will explore different types of variables and their usage.
Simple variables are inputs that can be set and reused during the Chain execution. Variables defined for a Workspace can be used across all Chains, and variables defined for a Chain can only be used for that Chain.
For your reference, here is a quick summary of OneCloud’s simple variables:
There are a variety of system-level variables that are available by default. The following lists what is currently available:
The numeric ID of the Chain in the non-running state
Chain Executer ID
The numeric ID of the currently running Chain
The Environment of the currently running Chain
The name of the currently running Chain
The unique URL of the currently running Chain
Chain Execution Date & Time
The date and time of the current Chain has started
Chain Previous Execution Date & Time
The date and time of when the Chain last ran
The numeric ID of the Command in the non-running state
Command Executor ID
The numeric ID of the currently running Command
The name of the currently running Command
The unique URL of the currently running Command
Runner Installation Directory
The location of a Command's GroundRunner (note: NULL with a CloudRunner)
System Date & Time Variable
The current system date
System Data & Time
The current system date and time
The email of the user running the Chain
The name of the user running the Chain
The numeric ID of the user running the Chain
📓 System Variables
System variables are globally available and can be modified and formatted by leveraging variable transformation.
Command Outputs can be considered variables since, depending on the command and usage, they can hold different data be leveraged by various commands.
Start Using Variables
Variables can be used as inputs to Commands, and they are available in any text-based Command input. To start using variables, select a Command with text input, and a variable selector will appear on the left-hand side of the Command. After selecting a variable, the variable will appear as a bubble in the relevant field.
📓 Connect your Commands!
If a Command is not connected to another one on the Chain, the previous Command's outputs will not be available in the variable menu. Make sure the Command is connected to the rest of the Chain before adding variables.
To remove a variable, use the backspace or delete key when the cursor is adjacent to the variable.
Variable and Text Concatenation
Note that for text fields, multiple variables can be selected and concatenated with text strings. Upon execution, the variables and text will be concatenated together.
Variable composition allows Chain and Workspace variables to contain other variables at the same level or above. This feature allows a range of possibilities to create new variables from existing variable values. The following is an example of creating a new file variable, "stacked_file", from the value of "stacked_file_dir".