# Variables, Datatypes, and Objects

## Input and Output Section

Any service created on the Syncloop platform utilizes input and output parameters for data exchange. The API request data variables are created in the input section, while the output parameters receive data provided by the service.

### Creating Variables in the Input Section

To create a variable in the input section, follow these steps:

1. Right-click on the mouse to open the context menu.
    
2. Select the desired variable type from the available options.
    

### Types of variables (available options)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686229353651/76a4ee87-3b44-4a37-9f07-2f2690ab85b9.png align="center")

### Creating Variables in the Output Section

Variables that represent data provided by the service as output are created in the output section. The process is similar to creating variables in the input section.

### Converting Variables into Array Elements

To use variables as an array, follow these steps:

1. Right-click on the variable.
    
2. Check the checkbox next to "It's an Array."
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686229862950/85c1a96d-099a-4f7f-b285-7f7f9d1fe633.gif align="center")

### Changing the Variable Type

To change the variable type, follow these steps:

1. Right-click on the variable in the input or output section.
    
2. Select "Properties."
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686230296706/c1fd5b85-3fef-4b1b-9805-32796bd28698.png align="center")

A properties dialog will appear. Click on the "Type" field and select the desired data type for the variable. Click "OK" to confirm the changes.

### Making the Variable Field Required

To mark a variable as required, follow these steps:

1. Right-click on the variable in the input or output section.
    
2. Select "Properties."
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686230624294/d78ad60e-8a47-4043-aa36-0e5fb58e5444.gif align="center")

In the properties dialog, enable the "Required" checkbox.

### Adding Validation to the Variable

Validation rules can be added to variables based on their data types. Let's consider a string variable for the following examples:

* Right-click on the string variable and select "Properties."
    

In the properties dialog, various validation options are available:

**String variable**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686230872277/fc741d79-e758-40c9-93a7-3221e4ca4ff7.png align="center")

* **Validation**: Specify whether the input should be an email or URL. If neither is selected, the input is treated as a normal string.
    
* **Override Regex**: Use a regular expression for advanced validation.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686230978146/c1e4dde2-9d7a-4856-bbb6-c42c97d64d6b.jpeg align="center")
    
* **Min Size**: Set the minimum length of the string.
    
* **Max Size**: Set the maximum length of the string.
    
* **Description**: Enter a description for the variable to provide additional information.
    

### Similar validation options are available for other variable types, such as number and date variables.

### In Number, the validation is done three ways:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686231121982/8c3372c1-af17-4f4e-b148-c3e6cab8c51c.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686231168065/a47defd9-623d-4897-9088-f2c766b06b1f.png align="center")

### In Date, the validation is done four ways:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686231225143/4812ff29-a7ea-4741-a577-63a05a00aedf.png align="center")

When working with date variables, you can apply the following validation options:

1. **Date Format**: Specifies the input format for the date variable. For example, the input can be in the format "DD-MM-YYYY".
    
2. **To Date Format**: This option specifies the desired output format for the date variable. For instance, you can convert the input format "DD-MM-YYYY" to another format like "YYYY-MM-DD". The output format can be customized to any desired date format.
    
3. **Start Date**: Specifies a minimum date constraint. The date entered must be greater than or equal to the specified start date.
    
4. **End Date**: Specifies a maximum date constraint. The date entered must be less than or equal to the specified end date.
    

**Note: The "Required" field will only work when you enable "Enable Validation" in the Configuration dialog box.**

To enable validation, click on the configuration tool at the top of the workspace and enable the validation option.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686231311943/2401bd26-a0b9-4999-90be-99ed3f8d5409.png align="center")

### Other Operations on Variables

In addition to creating and modifying variables, there are other operations that can be performed:

1. **Rename**: Rename the variables.
    
2. **Delete**: Delete the variable.
    
3. **Copy**: Copy the variable.
    
4. **Cut**: Cut the variable.
    
5. **Paste**: Paste the variables.
    
6. **CopyXPath**: Obtain the absolute path to the variable for platform access.
    
7. **Properties**: View and modify various properties of the variable.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1686231359812/982d7308-4316-4706-aa6b-70794b60f1b7.png align="center")

**Note:**

* Variables of any type can be cut, copied, and pasted within various sections of the workspace, but not directly on the root.
    
* Variable names follow the naming convention used in Java programming.
    
* Variables can be dragged and dropped within and outside various sections of the workspace. Input parameters can be dragged and dropped into the output section to create output parameters.
