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
| Parameter | Type | Description |
|---|---|---|
| id | string | ID of the variable to rename. |
| newName | string | New variable name. |
Returns:
void