blockly > Workspace > getVariableUsesById
Workspace.getVariableUsesById() method
Find all the uses of the given variable, which is identified by ID.
Signature:
getVariableUsesById(id: string): Block[];
Parameters
Parameter |
Type |
Description |
id |
string |
ID of the variable to find. |
Returns:
Block[]
Array of block usages.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `Workspace.getVariableUsesById()` method locates all blocks within a workspace that utilize a specific variable, identified by its unique ID."],["It accepts the variable's ID as a string argument and returns an array of `Block` objects representing the usages of that variable."]]],[]]