blockly > Block > setFieldValue
Block.setFieldValue() method
Sets the value of the given field for this block.
Signature:
setFieldValue(newValue: any, name: string): void;
Parameters
Parameter |
Type |
Description |
newValue |
any |
The value to set. |
name |
string |
The name of the field to set the value of. |
Returns:
void
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 `setFieldValue` method updates the value of a specific field within a Blockly block."],["It requires two parameters: `newValue` specifying the desired value, and `name` indicating the target field to modify."],["This method does not return any value (void) after execution."]]],[]]