Component with flow variable not returning value

I’m trying to do something that I think is very basic, and not getting expected behaviour. I’m assuming I’m just missing something as opposed to it being a bug.

I’m trying to create a component (one of my first) where you select a database alias from a list of options and the selected value is passed out of the component as a flow variable. I see the flow variable in the “Value Selection Configuration” node, but when I inspect the flow variables outside the component, it doesn’t exist. I’m assuming I’m having some sort of scope issue, but I can’t figure out how to resolve it.

I’ve tried defining the flow variable outside of the component and passing it in… no change. I’ve tried attaching the flow variable output from the configuration node to both the defined component flow variable output port and the intrinsic flow variable port. Neither work.

Here’s the component content:

And here’s how I’ve setup the ports in the component:

And finally, here’s the context in which I’m trying to use the component:

As I said… inside the component, on the “Value Selection Configuration” I see the flow variable “DatabaseAlias” as I would expect, with the value properly set. Outside the component, the variable doesn’t even exist, let alone have a value.

I’m sure I’m overlooking something really stupidly simple, so thank you to those that read and respond. I’m only a couple of days into using KNIME after switching from EasyMorph. Quite a different beast. :slight_smile:

1 Like

By default, flow variables that are created inside the component are only available inside the component, and flow variables that are created outside the component are only available outside the component.

To change this, you need to modify the Component Input and/or Output node. See the relevant section from the KNIME Components Guide

4 Likes

See… simple. :slight_smile: Thank you for the answer. I figured it must be a scope issue, but I couldn’t figure out how to change the scope. This worked as expected. Thank you again for helping out a noob. :slight_smile:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.