Unable to use flow variables in e.g. Excel Writer

Hi, I’m relatively new to Knime – I’ve reached the point where I want to create workflows which automatically populate filenames with the current date and so on.

My understanding is that this is done in knime using flow variables, but nothing i have done works. In presentation, my problem appears to be that when i click on the variable button to the right of the browse button (when setting the output path and filename for the Excel Writer) the ‘Use Variable’ checkbox appears to be permanently disabled. I’ve tried other, similar nodes (eg Excel Reader) with the same issue of the checkbox being permanently disabled. Also, I’ve tried several ways of populating the flow variable, with the expected value visible on the node output port, but still unable to click the ‘Use Variable’ checkbox in the downstream node.

I’m using the most recent version of Knime Analytics Platform.

Apologies in advance, I am not able to upload or download workflow files.

If anyone has any suggestions, they would be very welcome and appreciated.

All the best,

M

Hi @Mirri, welcome to the forum.

The most likely reason that the checkbox is disabled is that the node has not detected an appropriate flow variable. You need to supply flow variables in the correct format before they can be used.

when setting the output path and filename for the Excel Writer

What steps did you take to create this variable?

2 Likes

I found that with the new Excel Reader node you have to turn the flow variable from String to Path data type. This will then allow you to select the flow variable as the filename/filepath.

2 Likes

Hi Mirri,
starting with KNIME Analytics Platform 4.3 the Excel Writer node uses the new Path variable. If you already have a string variable you can use the String to Path (Variable) node to convert it to the new pPath variable. For details about how to create the variable have a look in the File Handling Guide.
Bye
Tobias

4 Likes

Thank you all for the welcome and the help - I was definitely missing the concept of converting the string to a Path type variable.

This is now working for me, but I’m wondering if it is normal to need 5 nodes to generate this?

  • Create Date & Time Range
  • Extract Date & Time Fields
  • Table Row To Variable
  • String Manipulation (Variable)
  • String To Path (Variable)

Can this be made more efficient?

All the best,

Mirri

Ah, i was able to replace the first four nodes with a single Python Edit Variable node.

Thanks again, all!

Mirri

1 Like

Hi Mirri,
the Create File/Folder Variables node might also help to reduce the overhead and helps with changing file separators across different file systems.
Bye
Tobias

2 Likes

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