Constant value from workflow variable

Hello. I am using Analytics Platform 4.1.3, and I have a question about adding a workflow variable to a table.

I have created a workflow variable max_limit of type double. Created through “Workflow Variable Administration” so that it is available to all the nodes at any moment. Now I need to use that variable, and so I want to add it to my table.
I try to use the “Constant Value Column” with my variable max_limit as “Value setting”:
im-1
But if I chose the new column to be of type double (as my variable max_limit is of type double), I get an error saying “Error on creating ‘Number (double)’ from input string: ‘’”. However, if I set the new column type to string, I get no error and a new column with the variable max_limit value in it, but of type string.
Am I not understanding how “Use Variable” option is supposed to work in the “Constant Value Column” node?

In addition - is there a cleaner way to add a workflow variable to a table? I managed to do that with the “Rule Engine” node, but I thought that “Constant Value Column” was a more logical option. Perhaps there’s another way I haven’t thought of?

Hi @a_pavlenko,

use java snippet simple node and the statement ‘return $${Dmax_limit}$$;’
The return type setting should also be of type ‘Double’

BR

1 Like

Yes, that works too, thanks. Will wait for some comments on “Constant Value Column” node though before closing the topic. Really curious about how that node is supposed to work.

hi @a_pavlenko,

the Variable to Table Column Node should be the right choice for your use case…

It will add your variable to all rows, where the name of the column corresponds to the name of the variable. You may also attach more than one column at once.

Greetz, Tommy

1 Like

Yes, this is the perfect solution, thank you. There was a variable input port on this node, and I thought it was mandatory input - so I didn’t realise it can use the workflow variables.

2 Likes

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

@a_pavlenko Just to add note that dummy number value need to be added into Constant Value Column in order for flow variable to overwrite it.

1 Like