--- title: "Variables Block" slug: "variables-block" updated: 2021-08-14T02:44:05Z published: 2021-08-14T02:44:06Z canonical: "help.pillir.io/variables-block" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.pillir.io/llms.txt > Use this file to discover all available pages before exploring further. # Variables Block These blocks are defined to declare and fetch variables. #### ## GetValue: This block functions as the getvalue element block where the method returns the current value of the form control. In most cases, a string is returned. In the case of multiple select boxes, an array of values is returned. | **Input** | **Output** | **Block Layout** | **Generated Code** | | --- | --- | --- | --- | | Variable Name to choose. Clicking the "Create Local Variable" block enables user to create new variables in the popup below. ![](https://lh6.googleusercontent.com/jPZtcNgHm57jhHvskaWjdlQuaLHk2KMO_VU3Yp0UfGL1yoPlrUb1GmqEt37GbCE_DiQicGRMnQtIIlsqUG4Ndv7WxfkbkvlegqBSWwEQUwt5NeCuPajB1J9xz6unI4nHbbHLCJAm) | value of variable any type | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620907154296.png) Once a variable is created, it can be fetched from this Oval block. ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620907210145.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620907227453.png) | ```javascript sample ``` | #### ## SetValue: In this block, the SetValue element adds or updates the value of the current element. The values are set based on their properties from the dropdown options within the block. | **Input** | **Output** | **Block Layout** | **Generated Code** | | --- | --- | --- | --- | | Variable Name to choose, Value (any type) | Set value to the variable | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620907336441.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620907350094.png) | ```javascript sample = 0; ``` | #### ## Create Object: In addition to the existing objects, the blocks also facilitate the users to create new objects. Users can create new objects where the variable blocks can be dragged and dropped. | **Input** | **Output** | **Block Layout** | **Generated Code** | | --- | --- | --- | --- | | The key or variable name as Text, The value for the key of any type. | Create Object using a key or variable and value pair. | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620907376131.png) ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620907394028.png) | ```javascript {variable_1 : ''} ``` | #### ## GetObject: The GetObject block is used for the following purposes. 1. It is used to create a function that takes the object as an input. 2. It uses the operation which checks if the object type is a function or not. 3. It is used to return the object if the object type is a function. | **Input** | **Output** | **Block Layout** | **Generated Code** | | --- | --- | --- | --- | | The Object, The key or variable name as Text | value from object based on key or variable name. | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620907414739.png) | ```javascript x.variable_1 ``` | ## SetObject: The SetObject block is used to iterate a collection of values through the elements of a set in insertion order. A particular value inside a set will occur only once and it's unique in the Set's collection. | **Input** | **Output** | **Block Layout** | **Generated Code** | | --- | --- | --- | --- | | Object, The key or variable name as Text, The value for the key. | Set value to the key or variable of the object. | ![](https://cdn.document360.io/718af901-247b-46be-8ace-83da21839237/Images/Documentation/image-1620907447345.png) | ```javascript x.variable_1 = val ``` |