Set Local Variable
This method lets you to update a new value to local variables
Parameters
Parameters | type | Description |
---|---|---|
variableId | String | Unique Id of variable |
value | String or Number or Boolean | New value to variable |
payload | Object | Object with keys as variableId and its values in respective data type |
Syntax
Follow the syntax to update a single variable:
Follow the syntax to update multiple variables:
Example scenario
Consider you have fetched employee details such as name, age & address during the page’s onload event. You can set local variables for all these fields and use them on different components inside the page, such as displaying labels or cards.