Create a column with drop down menu / list

If you drag from the top right of the Excel Write to template node, then you will get a red connector line. Drag that over and connect it to the top right of the File Opener component.

1 Like

Thanks @iCFO … if I could actually sell components, you’d be my top salesman! :wink:

@phil21oo , yes the Open File or Folder can be incorporated into workflows, and in fact this is something I have often done myself, but I originally wrote it to allow a user to specify a file location that they wished to open, as a String.

nb. the first part of this post describes how to use the existing component, but please scroll down for suggestion of a new component!

This means that when you have a Path flow variable, such as you can create from nodes like Excel Writer or Write to Excel Template, you need an additional step of Path to String (Variable)

image

All nodes/components have Flow variable ports even if you can’t see them so on KNIME 4.x (or Classic UI) you can right click on the Open File or Folder and select “show flow variable ports”, or in KNIME 5.x (Modern UI ) you simply hover the mouse over the node/component to see them.

To join it all up, in the Write to Excel Template node, you can create your path variable if you don’t already have one, as follows:

Then execute the Path to String (variable) node, and finally configure the Open File or Folder flow variable to use the “string” equivalent of the Path variable created by the Path to String (variable) node.

The additional part is telling the component what type of path this variable represents:

because it has to do some string substitutions if it is not an absolute path.

So there is a little bit of complexity but not too bad.

HOWEVER… :wink:

As luck would have it, a few weeks ago I was thinking about a dedicated “Path” version of this component, where you don’t have to do all the additional bits. And I didn’t get round to completing it. But since it’s been mentioned, I dug out what I had and joined a few things together, and you may be interested in trying out this component instead. It is hot newly uploaded to the Hub today, so please make sure you test that it works for you, as there may be things I have overlooked, but I would welcome any feedback or questions, and I will do my best to assist.

This is greatly simplified over the above. You still create a path variable as before, but then you just select that variable in the component’s config:

The only thing that remains from the previous component is the check-box of whether to physically open the location. This allows you to leave the component in place but turn off the opening of the file if for some reason you temporarily don’t want it to occur. With the check box de-selected, the component has no effect.

This is available from here:

Please treat it as “beta”. It should work, but let me know how you get on. Paths can be tricky things especially if they use KNIME’s relative addressing (e.g.“workflow data area”), so there may be things I have overlooked, or even cannot resolve but it should work for regular “absolute” paths and hopefully local relative paths too.

1 Like

Could imagine that write to excel template connect it via variable to excel writer node and append an emtpy table/nothing th the file sheet and open it could work as well but have not tried it, just guessing
br