Multiple Configuration Flow Variables

Hi, I have multiple configuration nodes as follows for a component:


Is it possible to connect these to the python script? If so how?
Thanks!

Try the Merge Variables Node

You can right click on it to add and remove additional ports as well.

4 Likes

Hi @azsb1g19 , The Merge Variables Node suggested by @iCFO is correct.

Or you can also chain the 3 nodes one after the other (Node 28 connects to Node 29, Node 29 to Node 30 and Node 30 to Node 24).

5 Likes

Nice hack there chaining the nodes :ok_hand:

Flow variables “flows” downstream, so at the final node you would always have access to previous flow variables.

1 Like

@bruno29a
Actually I’m a bit unsure about this:
image
If I print the flow variables, I only get the first configuration in the chain, node 28.

print(flow_variables)

OrderedDict([(‘path-input’, ‘C:\Users\alex\Downloads\New folder (2)’), (‘knime.workspace’, ‘C:\Users\alex\knime-workspace’)])

Actually I also get the same with this workflow too:

I figured out that the boolean configuration isn’t giving me a flow variable value?


image

Make sure you assigned all of your Configuration nodes different parameter / flow variable names.

@iCFO
They are all different:
image
image
image

You don’t see all 3 in the console window if you switch the view to flow variables when you selected a downstream node? Can the component / workflow be uploaded for us to review?

@iCFO
End Provenance Capture Component.knar (12.5 KB)

Just looked at it. The default value for your path variable is currently blank. Put a temporary dummy value in as the Default and re-run it.

Hi @azsb1g19 , I’m not sure how you are printing the values, but just looking at the flow variables, it works on my side.

Sample component:
image

This is what I entered as value:
image

My variables for each of the 3 configuration nodes are:
string-input
boolean-input
boolean-input_two

Here are the values I see for each of them:
image

EDIT: I think I know what the issue is. Not sure if it’s a bug, but it looks like the Python Script does not see the flow variables of type Boolean for some reason.

If I use the option “Output as Integer” for the 2 Boolean nodes, then I am able to see the variables:
image

I am not able to see all the variables in the Python Script:
image

And if I do a print(flow_variables), I get all the values:
OrderedDict([('boolean-input_two', 0), ('boolean-input', 1), ('string-input', 'test'), ('knime.workspace', 'C:\\Knime\\knime-workspace')])

This is more of an issue with the Python Script node than merging flow variables. As far as your request is concerned, it’s resolved in the sense that all the variables are being passed.

You may want to open another thread about passing the variables to Python Script.

1 Like

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