Help needed: Cannot use StringArrayType Flow Variables anywhere else in my flow?

As title says, I have created array flow variables that are type StringArrayType. I want to use this flow variable in later steps such as Rules Based Row Filter or the DB Query Reader, however I can only see my flow variables that are of type String and not StringArrayType.

Can I convert my StringArrayType into a String to be used later in the flow? Not sure how to proceed. Thanks

Hi @chrismastri and welcome to the KNIME communiy forum,

Unfortunately, the colletion/array type flow variables are not supported in expression-based nodes you mentioned but we have a ticket to tackle this in future: AP-13121

As a workaround:
If you are trying to use “IN” in the mentioned nodes:

  • For DB Query you can replace the array part enclosed in parentheses with string flow variable. For example:
SELECT * FROM #table# AS "table"
WHERE "First_WebActivity_" IN ('1','2')

Could be parameterized as:

SELECT * FROM #table# AS "table"
WHERE "First_WebActivity_" IN $${Svariable_1}$$

Where
$${Svariable_1}$$ = ('1','2')

  • For Rule Based Row Filter you can provide the rule(s) as a flow variable to include a list of items. The value of the flow variable should be exactly the same as the expression you would input manually:

If you want an expression like this:

$column1$ IN ("1", "2") => TRUE

you should create a string flow variable with the same value and then assign it to the “rules” in the flow variable settings of the node.

To create such a flow variable, I would suggest to create the list as a string variable first and then use a String Manipulation (Variable) node to create the final expression.

Please give it a try and don’t hesitate ask any further questions.

2 Likes

Hi, looking for a similar thing, I cannot access my string array within generic JS node which would be very useful.
+1 to AP-13121

moved to feedback and ideas section so people can start voting for this…

1 Like