Java Snippet outCols config

Hello,

I was trying to set the Name attribute of my Java Snippet Output variable using a Flow Variable.

My current workflow is to

  1. fetch data from a database
  2. define the name of the key column in the table using a Flow Variable, eg product_id
  3. rename the key column to key_column using the Flow Variable
  4. transform the key column using a Java Snippet. They key column is now always called key_column so I can easily reuse the Java Snippet Node.
  5. set the output Name to new_key_column
  6. rename the column new_key_column using the Flow Variable, eg rename to product_id

From the Flow Variable config tab in the Java Snippet Node I would assume that I could set the output Name (and perhaps even input) dynamically, using the Flow Variable. Is there any documentation on how to set the config properly?

Hi @henrich

You can use a little trick to find out what the proper usage of the flow variables is. Assume this is my Java Snippet:

If you then go flow variables, outCols, type in some random numbers and execute the node. This will give you an overview of what the current values are based on what you defined in the snippet itself.

If you then review the flow variables you’ll find the proper syntax for them and you can apply the actual flow variable.

2 Likes

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