I use KNIME to process data and create a CSV file that is used in a downstream application.
For the downstream application I need some metadata from the workflow. Is there a way/node to create a longer text file using flow variables?
The idea behind this is to create commented queries for the downstream application and export them to a file next to the CSV data.
@mpreusse you could extract several meta information from the workflow, the files you use or the current table/data in knime.
(And there are more)
You can then store that into a table, if you have a variable you can convert that to data. The data you can then store in any format you like.
In this example you can see how to extract meta information from a file:
5 Likes
Thanks @mlauber71 for the pointers!
I begin to understand how I can handle metadata. I also found the Table Creator node that I can use to store comments and the queries I mentioned.
There is one thing I did not find yet:
Is there a way to create a variable or table and store a string with a flow variable? Something like:
Some text here that uses $some_variable_from_flow
1 Like
@mpreusse glad you liked the links
If you just want to create texts you could use a Java Snippet (simple) either to create a Flow variable or a column, which then you could convert into a column in a table or a Flow variable.
Simple Java snippets have these
return <your content>;
Syntax where the content can also contain results from a Flow variable. With a little planning and experimenting you have nearly endless possibilities to combine information.
I built this example from the previous one where you could use a combination of columns and Flow Variable in a simple Java Snippet. It might serve as another inspiration.
[image]
The code is like this:
// make the incoming Flow Variable into a Java variable
double v_input_factor;
v_input_factor = $${Dinput_factor}$$;
// convert the double Java variable into a string to use in the code
// https://www.journaldev.com/18380/java-convert-double-to-string
String v_input_factor_string = new Stri…
Another powerful tool is the
Of you could just use the Rule engine, which also is quite handy:
3 Likes
Thanks @mlauber71 , I did not know about the simple Java Snippet before, that is really flexible.
3 Likes
system
Closed
September 26, 2021, 9:43am
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.