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.
Thanks @iCFO ⌠if I could actually sell components, youâd be my top salesman!
@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)
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âŚ
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.
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