Dropdown (obvpm):
The Dropdown (obvpm) node is a versatile tool designed to allow you to define a custom list of options from which a single choice can be selected. This node is particularly useful for scenarios where you need to drive decision-making processes based on user-defined inputs. By providing a list of choices, each on a separate line, you can easily select one option, and the node will output the selected choice verbatim, its position in the list, and the entire list of options. This functionality is especially beneficial when used in conjunction with a Lazy Case Switch, as it allows for seamless integration and routing based on the selected option. The Dropdown node simplifies the process of managing multiple options and ensures that the selected choice is accurately reflected in subsequent operations.
Dropdown (obvpm) Input Parameters:
options
This parameter allows you to define the list of choices available in the dropdown. Each choice should be entered on a separate line, and any blank lines or surrounding spaces will be ignored. The default value is a multiline string containing "first", "second", and "third". This parameter is crucial as it determines the available options from which a selection can be made. By editing this list, you can dynamically update the dropdown's contents to suit your specific needs.
selected
This parameter specifies the initially selected choice from the dropdown. It is displayed as a dropdown of the options defined in the options parameter. If left empty, the first option in the list will be selected by default. This parameter is important for setting a default selection or for programmatically selecting a specific option based on external conditions.
Dropdown (obvpm) Output Parameters:
value
This output provides the selected line from the dropdown, exactly as it appears in the options list. It is useful for passing the chosen option to other nodes or processes that require the specific value selected by the user.
index
This output returns the position of the selected option within the list, starting from 0. It is helpful for scenarios where the position of the choice is needed for further processing or decision-making.
options
This output delivers the entire list of options, unchanged. It can be wired into a Lazy Case Switch's cases input, ensuring that both nodes share the same source of options. This output is essential for maintaining consistency across nodes that rely on the same set of choices.
Dropdown (obvpm) Usage Tips:
- Ensure that each option in the
optionsparameter is on a separate line to avoid errors and ensure clarity in the dropdown list. - Use the
selectedparameter to set a default choice that aligns with the most common or recommended option for your specific use case. - When integrating with a Lazy Case Switch, connect the
optionsoutput to thecasesinput of the switch to maintain a consistent set of options across nodes.
Dropdown (obvpm) Common Errors and Solutions:
"Dropdown: the options list is empty -- put one choice per line in the options widget."
- Explanation: This error occurs when the
optionsparameter is left empty, meaning no choices are available for selection. - Solution: Ensure that you provide at least one option in the
optionsparameter, with each choice on a separate line.
"Dropdown: '<chosen>' is not one of the options (<options>). Pick again from the dropdown, or restore that line."
- Explanation: This error indicates that the selected choice is not present in the current list of options.
- Solution: Verify that the
selectedparameter matches one of the options in theoptionslist. If the list has been edited, update theselectedparameter to reflect a valid choice.
