Skip to main content

Home > blockly > Workspace > renameVariableById

Workspace.renameVariableById() method

Warning: This API is now obsolete.

v12: use Blockly.Workspace.getVariableMap().renameVariable

Rename a variable by updating its name in the variable map. Identify the variable to rename with the given ID.

Signature:

renameVariableById(id: string, newName: string): void;

Parameters

ParameterTypeDescription
idstringID of the variable to rename.
newNamestringNew variable name.

Returns:

void