Is it possible to have a list of strings as a unique flow variable?

Hello,

I would like to know if it’s possible to have a list of strings as a unique flow variable?

In my workflow there is a python node that depends os a list of TAGS to make a web service call.

Defining this list of tags inside python would be something like:

tags = [‘3402FC0117:pos’,
‘340224001M:cur’,
‘3402FC0117:me’]

I’d like to have this list as a unique flow variable. Is it possible?

From what I have heard, it is currently not possible to have a list as a flow variable.

1 Like

Hi there!

What do you mean with unique? Flow variables type can be String, Integer or Double.

What you can do (at least I think you can!) is to define each tag as a flow variable and then inside python have something like:

tags = [flow_variable1,
flow_variable2,
flow_variable3…]

if your idea is to have these tags not defined in Python. Also you can concatenate (with appropriate syntax in between) all these flow variables representing tags into one flow variable and then have only this in Python:

tags = [flow_variable_list]

Br,
Ivan

1 Like

Hey @umveloso,

if you need the tags in a list in python put all the tags into a string and split it in python into list.
Bildschirmfoto%20von%202019-05-02%2014-58-44
Bildschirmfoto%20von%202019-05-02%2015-00-24
Bildschirmfoto%20von%202019-05-02%2015-00-42

I hope this is what you need
Andrew
python_test.knwf (12.0 KB)

8 Likes

That’s it! great!
Thank you very much @Andrew_Steel

1 Like

Hi Andrew,
I am trying to do something I think very simular.
I am trying to use each record in a table as Flow Variables.
Is there a node or a way that performs this?

Look at


and

nodes.

Hi @DavisRogers,

if you want to iterate over each record take a look at
Table Row To Variable Loop Start

1 Like

Thanks so much, I did find that as the Solution.

I am now looking at a challenge with the “Rule Engine Node”
For Example…
// This is a comment $Col0$ > 0 => “Positive”

When the values in Col0 are greater than 0, we [assign]
$Col0$ = “Active” AND $Col1$ <= 5 => “Outlier”

.
It appears to apply rules and will allow for the condition to be a “String” like Positive or Outlier.

I am needing the condition to be a Formula from the Columns in the table instead.
Is there a node for this?
I was thinking that maybe I have to apply the Rule Engine 1st, then use the results of the Rule Engine to use a calculation from a certain column? I appreciate any insight on this challenge.

You can use


for more flexible use of formulas.

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