Variables Block
  • 14 Aug 2021
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Variables Block

  • Dark
    Light
  • PDF

Article summary

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. 

value of variable any type


Once a variable is created, it can be fetched from this Oval block. 

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


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.


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

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.

x.variable_1 = val

Was this article helpful?

What's Next
ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence