How to set file name in SDF Writer node with variable

Hi,

I am creating a simple workflow for selection of a diverse subset of molecules for the Web Portal, and in the end want to be able to download the subset as an SDF file.I am trying to set a temporary folder and file name with the Create Temp Folder node but am unable to set the file name variable in the SDF Writer node, it just doesn’t show up among the available variables, despite the Create Temp Folder showing it in its variable outputs (file). So I am a bit at a loss here…

Tips appreciated!

!

If you look closely at the icons in the Flow Variables tabs of the respective node configuration/results windows, you’ll see that

  1. The SDF Writer node expects the filename flow variable to be a string variable (but will accept an integer)
  2. The flow variable you created in the Create Temp Folder node is a path variable

You’ll need to use a Path to String (Variable) node to convert your path variable to a string variable.

There is more information in the file handling guide.

2 Likes

Hi, this was really helpful (albeit not very obvious). But now I have a new problem: the output generated for download is not an SDF file but HTML…

I got it to work now, so can actually download the SDF file with selected subset :slight_smile:

But am still confounding regarding the File Upload Widget. IfI don’t specify a default file (e.g. one on my Windows desktop) the workflow does not work. If I specify one on my desktop, the workflow works but only if I upload a new one when running the workflow in the WebPortal. So the default file really has no function, yet it is required for the workflow to run as intended (i.e. by choosing another or the same file for upload).

There is a demo WebPortal workflow ‘WebPortal Data Mining (basic)’ example quite similar to what I want. This has a default file specified ‘knime://knime.workflow/CurrentDetailData.table’ (see image) and this file is in fact physically residing in the corresponding workflow folder on the server, and is visible through the KNIME GUI

If I put my default SDF file under the …/data folder of my workflow on the server it is not visible through KNIME GUI, and it disappears after running the workflow. This does not happen with the demo workflow. I can’t figure out how they have been configured differently.

But most likely I have missed some hidden feature so if anyone can enlighten me I would be grateful.

Thanks/Evert

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