Create a column with drop down menu / list

Hello,

is it possible to create a new column, which contains a dropdown menu where you can select different variables? Like big, medium, small

image

Thx for your time!

Hi @phil21oo

Take a look at the Single Selection Widget – KNIME Community Hub. And / or read more about the wonderful world of KNIME widgets is this KNIME blog.
gr. Hans

4 Likes

thx, i tried it, but i dont know how to use it, are there any examples?

On the page that Hans mentioned, scroll down to the Related workflows & nodes section. All the workflows listed there use that widget that you can use as example

2 Likes

Hi thx, i know it sounds weird for you as experts, but i am not a professional and it is very hard to understand for me. I already looked at the examples but i am not able to solve the problem.

Hello @phil21oo ,

I think I missed the main point of your question. What are you trying to achieve with the drop down menu? If you can, upload a small dataset (few fake data should be enough) and show us what you are trying to do :slight_smile:

Have a nice day,
Raffaello

1 Like

Hi, thank you very much.

I try to explain it:

image

What’s not very clear is if you want the user to make this selection in KNIME or that you want KNIME to write to the Excel in such a way that it shows this dropdown with the values.

1 Like

Hi thx, i want KNIME to write to the Excel in such a way that it shows this dropdown with the values and select the values later by my own in the excel sheet

Using a Table Edit node could be the closest solution to what you need.
You won’t have a dropdown column as in Excel, but you could manually insert the value you need with copy/paste.

Create an empty column just before using the Table edit node, so you will find the empty column to be filled with your values. Then use the interactive view to fill the cells.

If you had a way to determine the value (big/medium/small) based on other attributes of the dataset, we can find something better.

I’m open for improvements to this solution, if @ArjenEX, @HansS or someone else knows a better way :slight_smile:

Raffaello

1 Like

You could employ OpenPyxl to edit the resulting Excel file to have such a dropdown list:

2 Likes

hi, thx now i downloaded the workflow

but it just shows when i start it
image

What do i have to do to that it looks like this?

image
image

@phil21oo you will have to edit the python code and provide some informations. The number of lines in this example is being automatically determined:

1 Like

It is much easier to use the Excel Write to Template node to preserve drop-down lists already defined in an Excel document. You can also use KNIME to write the list values options into the referenced data cells.

I use it to create KNIME driven fully built user interactive dashboards in Excel. It really opens up nearly infinite possibilities of leveraging Excel’s portability and UI tools after the heavy data prep has been done in KNIME.

3 Likes

thx, it could be so easy! Thank you so much!

Just one little question, is it possible to automatically open the file when the workflow is over for the “write to excel template”? Like in the excel writer?

I don’t remember a built in setting, but there are components for that. I have a manual trigger one for files in the data folder, but if you want it to open on every execution then you can try this one by @takbb

2 Likes

nice thats good, is it possible to integrate it in the workflow? So when the workflow is done it opens automatically, so i dont have to start it manually? Maybe a trigger or sth like this

1 Like

Simply connect a flow variable to it to trigger it at the correct time in the flow. I believe that it can also accept a flow variable if the file path, but not positive.

2 Likes

thx, this sounds complicated, i just worked with connection arrows but there is no arrow to connect

image