Skip to content

Set Variable

This method lets you update the value of a global variable used in the app.

Parameters

ParameterstypeDescription
variableIdStringUnique Id of variable
valueString or Number or BooleanNew value to variable
payloadObjectObject with keys as variableId and its values in respective data type

Syntax

Follow the below syntax to update a single global variable:

kf.app.setVariable(variableId, value);

Follow the below syntax to update multiple variables:

kf.app.setVariable({
variableId: "new value",
variableId2: 1
});

Example

This command can be used to update an employee’s personal information such as their dependants, contact number, and address that could be of varied variable types.