Skip to content

qie.setVariable

Signature: qie.setVariable(name, value)

Returns: void

Sets the global or local variable specified name with a new value.

Parameters

Type Name Description Default
String name the name of the global or local system variable
String value the new value for the variable

Example

// Set a table variable by parsing CSV data
var csvString = `
book title, author
Harry Potter and the Chamber of Secrets, J.K. Rowling
The Way of Kings, Brandon Sanderson
`;
var firstRowIsHeader = true;
var separator = ",";

qie.setVariable(
    "myVariableTable",
    qie.getVariable("myVariableTable").parse(csvString, firstRowIsHeader, separator)
);

// Set a simple string variable
qie.setVariable("simpleVariable", "newValue");