I want to parameterize the DB Row Filter with flow variables. To get familiar with the flow variable configuration I would like to consider a very simple case. The DB Row Filter shall perform the following task: Search in a column ‘Source ID’ for the entries ‘1000001234’ and ‘1000001235’. So, behind the scenes the knot should do the following:
SELECT * FROM my_table_name
WHERE SourceID IN (‘1000001234’, ‘1000001235’).
Good question and to start with I felt it was not too straight forward.
The trick is that you need a flow variable that has the options you want to select as a string with each value inside single tick quotation marks:
e.g. myVar:
'Option1', 'Option2'
If you have that variable, you can pass it into your query:
Select * from...
WHERE "columnToTest" IN ($${SmyVar}$$)
Example in the red box… I grab first two rows from a data set as an example
Then use Expression Node to put quotation marks around the target column
Then use Group by to aggregate that column using unique concatenate as aggregation function
Then turn that into a variable and pass that variable into DB Query node:
SELECT * FROM #table# AS "table"
WHERE "Gene stable ID" IN ($${SGene stable ID}$$)
many thanks for your support! I wasn’t aware that there is also DB Query knot which I took now and which is way easier to parametrize! So, my workflow is running as desired. Have a nice remaining day!