Skip to content

Get Local Variable

This command lets you retrieve the value of a local variable.

  • The scope of page variables are limited to the page they are declared in.
  • Page variables do not persist like global variables, therefore revisiting a page will reinitialize all of its page variables.

Parameters

ParameterType
variableIdString

Syntax

const pageVariable1 = await kf.app.page.getVariable("variableId");

Returns

Returns the value of variable, which could be of the following data type in relation with the variable type.

Variable typeData type
TextString
NumberInteger
DateTimeString
BooleanBoolean

Example

Local variables can be used to store the individual ratings given for different criteria (e.g., communication, teamwork) within the performance review form. Using local variables for the individual ratings would make it easier to calculate the final rating for performance evaluation.