# Variables command group

### <mark style="background-color:orange;">**Variables**</mark>

With the Variables command, you can add variables of the following data types:

1. **Text:** Alphabetic characters (e.g., ID, Name,...)
2. **Number:** Numeric values, including integers and decimals (e.g., 0, 5, 10, 13, 0.5, 0.8,...)
3. **Boolean:** Logical values, with only two possible states: True and False. True represents the satisfaction of a condition, while False represents the dissatisfaction of a condition.
4. **Object:** Reference data type, capable of storing various data types within a single variable.
5. **Array:** Array data type, where you need to input an array formatted as JSON.
6. **File:** You can add any type of file such as .txt, .docx, .xlsx,...

You must enter a variable name when adding to declare its existence, but it's not necessary to add a value as you can assign a value when creating automation scripts.&#x20;

After adding variables, you can search for them by name or delete them if not in use.

<figure><img src="https://4124472707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3GxBkpnRvhRE3DopYR6v%2Fuploads%2Fm0kLYu7af5cPSLmUUs5p%2Fvariables.png?alt=media&#x26;token=8a4e0256-ece2-41bf-a1be-f02133881a5f" alt=""><figcaption></figcaption></figure>

### <mark style="background-color:orange;">**Set variable**</mark>

To assign a value to a variable when creating an automation script, use the Set variable command, including:

1. **Variable:** Select the variable to assign a value to, usually empty variables (without a pre-added value).
2. **Operator:** Choose the operation to perform.

* *Assign "=":* Assign a value to the variable.
* *Number "+,-,\*,/":* Perform addition, subtraction, multiplication, and division on numbers.
* *Other "Concatenate":* Concatenate strings or add elements to an array.

3. **Variable/value/number:** Assign a value, a number, or another variable (previously added using the Variables command) to the variable.

<figure><img src="https://4124472707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3GxBkpnRvhRE3DopYR6v%2Fuploads%2FdDkDyHhIe17Qm3VRMpgW%2Fset-variable-1.png?alt=media&#x26;token=16b2e853-9e93-43c0-a0c3-1c86a1755b71" alt=""><figcaption><p>Click on three dot icon to Edit command</p></figcaption></figure>

<figure><img src="https://4124472707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3GxBkpnRvhRE3DopYR6v%2Fuploads%2FooCZSIFptLkbN7pDzdOk%2Fset-variable-operator.png?alt=media&#x26;token=70886890-bc98-4422-88ab-b1d066a5aa7b" alt=""><figcaption><p>Choose your needed operator</p></figcaption></figure>

### <mark style="background-color:orange;">**Slice variable**</mark>

Use the Slice variable command to read and slice strings. For example, if you want to read a file and separate its data into individual variables:

1. **Variable:** Choose the variable containing the string to read or slice.
2. **Object:** Select the type of string read.

* `Any line:` Choose any string per line.

<figure><img src="https://4124472707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3GxBkpnRvhRE3DopYR6v%2Fuploads%2FfE2qiw1CoG3WtI7cfl8A%2Fslice-variable-any-line.png?alt=media&#x26;token=6a133fe4-377d-4642-a0b3-269eb4b599c6" alt=""><figcaption></figcaption></figure>

* `A line with delimiter`: Choose to read/slice strings within the same line. If you select this object type, you will need to specify:
  * *Any line:* Choose any string within that line.
  * *Delete line after used:* Delete the string after reading.
* `Multiple lines with delimiter`: Choose to read/slice strings across different lines. You need to set additional options as follows:
  * *Any line:* Choose any string within those lines.
  * *Delete line after used:* Delete the string after reading.

3. **Delimiter:** Input the character identifying the string delimiter (e.g., ";", "|",...). If you don't enter a delimiter, the system will take all text in that line.
4. **New variable name:** Assign the sliced string data to new variables.

<figure><img src="https://4124472707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3GxBkpnRvhRE3DopYR6v%2Fuploads%2FapL9Nd0t6cLiPuiJMkCw%2Fslice-variable-a-line-with-delimiter.png?alt=media&#x26;token=5ab5c79d-f952-4145-bfbf-71a42b219b24" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4124472707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3GxBkpnRvhRE3DopYR6v%2Fuploads%2FfBgivYT2LkqNM7adIGlt%2Fslice-variable-multi-lines.png?alt=media&#x26;token=2ccff879-4e59-4792-8254-903570bfc2f9" alt=""><figcaption></figcaption></figure>

### <mark style="background-color:orange;">**Export variable**</mark>

The Export variable command is used to export variable values to a new file. This command is typically used after the Slice variable command to save the data of a sliced file.

1. **Variable:** Choose the variable containing the value to export.
2. **Output:** Select the file to export the value to. You need to create a file on your computer and paste the file path here.
3. **Mode:** Select the type of value writing.

* `Overwrite:` Overwrite the file. This writing type will replace the entire current content of the file with the new data you provide.

<figure><img src="https://4124472707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3GxBkpnRvhRE3DopYR6v%2Fuploads%2FHZsxjwri26qC2V07ZZj8%2Fexport-variable-overwrite.png?alt=media&#x26;token=69dbccc4-dd0e-4701-9f56-72ccdc23ceb3" alt=""><figcaption></figcaption></figure>

* `Append:` Append data. This writing type will append data line by line or write to the same line of the file, depending on the settings:
  * *New lines:* Write to a new line.
  * *Same lines:* Write to the same line. If writing to the same line, you need to enter a "Delimiter" - the character separating strings.

<figure><img src="https://4124472707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3GxBkpnRvhRE3DopYR6v%2Fuploads%2F9haPy5IMbbCmI7jhdIk0%2Fexport-variable-append.png?alt=media&#x26;token=e5615ecf-68c6-4b5d-b792-8a84b2aa99ff" alt=""><figcaption></figcaption></figure>
