Stay organized with collections
Save and categorize content based on your preferences.
blockly > Block > getInput
Fetches the named input object.
Signature:
getInput(name: string): Input | null;
Parameters
Parameter |
Type |
Description |
name |
string |
The name of the input. |
Returns:
Input | null
The input object, or null if input does not exist.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eBlock.getInput()\u003c/code\u003e method retrieves a specific input object from a block using its name.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts the input name as a string parameter and returns the corresponding Input object if found, otherwise null.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use this method to access and manipulate individual inputs within a block for customization and interaction.\u003c/p\u003e\n"]]],["The `Block.getInput()` method retrieves a specific input object from a block. It accepts a string `name` parameter, which identifies the desired input. The method then returns either the corresponding `Input` object or `null` if no input with the given name exists within the block. This allows you to access and manipulate individual inputs associated with the Block.\n"],null,["[blockly](./blockly.md) \\\u003e [Block](./blockly.block_class.md) \\\u003e [getInput](./blockly.block_class.getinput_1_method.md)\n\nBlock.getInput() method\n-----------------------\n\nFetches the named input object.\n\n**Signature:** \n\n getInput(name: string): Input | null;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|-----------|--------|------------------------|\n| name | string | The name of the input. |\n\n**Returns:**\n\n[Input](./blockly.input_class.md) \\| null\n\nThe input object, or null if input does not exist."]]