Create new variables from a table in a loop

I regularly share KNIME workflows with colleagues. We should be doing this on a server but it is not always feasible. To simplify sharing we configure the folder path to “input” and “output” data as workflow variables something like this…

Image%202

We then reuse these workflow variables as a base to create new variables to fetch new input files or determine the path and file names for output files (… etc). In big flows this can make things really messy with loads of “String Manipulation (Variable)” nodes and links all over the place.

Is there possibly a way to read the variable names from a table and create any required new variables in a loop something likes this…

Image%205

Thanks
tC/.

Hi @TigerCole -

If I’m understanding you correctly, you don’t need a loop for this. Just create a table with a single row, where each column is the name of your flow variable:

2020-01-21%2010_09_04-Manually%20created%20table%20-%200_289%20-%20Table%20Creator

Then use the Table Row To Variable node to convert them over:

2020-01-21%2010_09_40-Variables%20Output%20-%200_290%20-%20Table%20Row%20to%20Variable

If you wanted this process to be more interactive - as opposed to reading from a static table - you could also use a series of String Configuration nodes, and wrap them inside a component:

Does that help?

2 Likes

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