blockly > Workspace > getVariableById

Workspace.getVariableById() method

Find the variable by the given ID and return it. Return null if not found.

Signature:

getVariableById(id: string): VariableModel | null;

Parameters

Parameter Type Description
id string The ID to check for.

Returns:

VariableModel | null

The variable with the given ID.