thx for your hint, but I still donāt get it right.
What exactly do I have to do to rename/update a variableās name? I encountered, that the checkbox for āReplace Variableā just replaces the old value, but doesnāt change the name of the variable.
If I want the right named variable I only get it without replacing it and save it as a new variable, that sits right next to the old one, with no chance of deleting the old one.
As per the OPās link, this topic has been around for ages. Itās probably for a reason why KNIME devs arenāt very keen on implementing this. My assumption would be that variables either originates from table columns (which you can rename in advance) or by manual creation (whereby you have control of the name.) So Iām curious about the use case where having such a node would come into play.
@prashant7526 , if you do have a use case where perhaps a specific node creates a variable with a name over which you have no control, and you actually want it to have a different nameā¦
The only way I know of achieving that is to create a component and have the original variable creation occur inside the component.
You would then replicate that variable using something like Variable Expressions and then on the exit from the component you only let the new variable leave the component (by configuring the Component Output node).
All flow variables created inside a component do not exit the component unless explicitly allowed to leave.
To be honest you have to really want the name to be different. It feels like a lot of effort for a variable name. (welcome to the KNIME forum, btw)
For me the use case is in that cases, where variables originate from table columns/rows (i. e. āTable Column to Variableā).
@ArjenEX You are right with, that I could work on the naming in advance. But in some cases I would find it more convenient to update the variableās name afterwards. (i. e. in ā Variable Expression Nodeā)
The method of creating the variable in a component sounds interesting. But like you say @takbb: It seems like a lot of effort. I wouldnāt choose that method either.
So, in conclusion I will have to find a way to control the variableās names beforehand, rather than get confused with meaningless variableās names.
I mean, we can create a new variable with a different name. In my case, I needed a specific name. So, I copied the older stay, but the point is that it solved my purpose of having a specific name for the Variable (that is why I wanted the option of renaming, right?)
Hi @prashant7526, Iād suggest you are actually copying or duplicating a variable rather than renaming it, but if your aim is simply to have a new variable (with a specific name) that contains the original value then thatās great.
There is currently no facility to actually rename a variable in KNIME, such that the old variable name ceases to exist, but youāre right that this may not matter.