Variables Component
  • 13 Feb 2023
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Variables Component

  • Dark
    Light
  • PDF

Article Summary

The Variables component comprises of blocks that are defined to declare and fetch variables. 

Create Local Variable

This block creates a local variable that is available only within the particular component behavior. The variables created are listed in the items oval block dropdown list. The items block can be used within any other component block to declare variables.

Note
The business function variables created in the APM is available by default in the items block dropdown list.
InputOutputBlock LayoutGenerated Code
Click the "Create Local Variable" block to create new variables in the popup window below:
CreateVariable

Value of variable any type


Once a variable is created, it can be fetched from the Oval block below:

Itemblock-dropdown




NA

SetValue

In this block, the SetValue element adds or updates the value of the current element. 

InputOutputBlock LayoutGenerated Code

Choose Variable Name from the dropdown list,

Value(any type) in input-1


Set value to the variable



 
 var item;


async function er_1671099636_change(e,obj,index){
   item = 0;

Create Object

In addition to the existing objects, this block facilitates the user to create new objects. Users can create new objects where the variable blocks can be dragged and dropped. 

InputOutputBlock LayoutGenerated Code

The key or variable name as Text, 

Value for the key - any type.


Create Object using a key or variable and value pair.


 
{variable_1 : ''}

GetObject

The GetObject block is used to get the value of a key in an object.

InputOutputBlock LayoutGenerated Code

Object - input-1

Key or variable name as Text - input-2


value from the object based on key or variable name.




__er.getState("variable_0").variable_1;

SetObject:

The SetObject block is used to set a value to the variable in an object.

InputOutputBlock LayoutGenerated Code

Object - input-1

The key or variable name as Text - input-2

The value for the key as text or variable - input-3


Set value to the key or variable of the object.


x.variable_1 = val


Was this article helpful?

What's Next
ESC

Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses