> For the complete documentation index, see [llms.txt](https://docs.novacura.com/flow-connect/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.novacura.com/flow-connect/reference/how-to-guides/sql-list-parameter-support.md).

# SQL List Parameter Support

## Overview <a href="#user-content-overview" id="user-content-overview"></a>

This feature enables list variables to be used directly in SQL `WHERE IN` clauses while maintaining full parameterization support. Previously, designers had to manually construct comma-separated value lists for `IN` clauses.&#x20;

With this enhancement, list variables can now be passed directly into SQL queries.\
The connector automatically expands the list into individual SQL parameters internally.

This feature is supported across all database connectors, including:

* Microsoft SQL Server (MSSQL)
* Oracle
* IFS 10
* ODBC

Only primitive value types are supported within list variables, including:

* Text
* Number
* Boolean
* Datetime
* Null

## Problem Statement

Before this feature, designers often had to manually build SQL statements like:

```
WHERE Id IN (1,2,3,4)
```

or dynamically concatenate values into query strings.

## Supported Usage

### 01. List variables can now be used directly inside `WHERE IN` clauses.

Example :

<figure><img src="/files/3nGkWIMf9JkCvCfLk34j" alt=""><figcaption></figcaption></figure>

Here, userIds can be primitive values, passed from a previous Assignment step or as the result of a previous Script step.

Example : userIds = \[1, 2, 3]

### 02. Using Seq Module Results in `WHERE IN` Clauses

We can pass results from some [Seq module functions](https://docs.novacura.com/flow-connect/reference/reference/flowscript/walkthrough/seq-module)  directly into `WHERE IN` clauses for filtering.

These functions help transform or extract values from sequences, which can then be safely used as list parameters.

**map**

Use the `map` function to transform each element of the original sequence and pass the resulting values into the `WHERE IN` clause.

```
// Example

// Script Step

open Seq;  
  
let languages = [  
  { name: "Swedish", code: "sv" },  
  { name: "Tamil", code: "ta" },  
  { name: "Dutch", code: "nl" }  
];  
  
return languages.map(l => l.name);

// Output result should be : ["Swedish", "Tamil", "Dutch"]
```

Just assume that you have a database table \[dbo].\[Language] containing multiple languages. Now, we can use the **IN** clause to filter the values that we want to **map** from the above sequence.

```
// Example

// Machine Step with a MS SQL database connector

SELECT Id, Name, Code
FROM [dbo].[Language]
WHERE Name IN @result
```

**collect**

Use the `collect` function to extract and flatten values from each element in the sequence. This is useful when each item contains a list of values.

```
// Example

// Script Step

open Seq;  
  
let users = [  
  { name: "Frida", groupIds: [12, 144] },  
  { name: "Hassan", groupIds: [30, 1] }  
];  
  
return users.collect(u => u.groupIds);

// Output result should be : [12, 144, 30, 1]
```

Assume that you have a database table \[dbo].\[UserGroup] containing multiple groups. Now, we can use the **IN** clause to filter the values that we want to **collect** from the above sequence.

```
// Example

// Machine Step with a MS SQL database connector

SELECT *
FROM [dbo].[UserGroup]
WHERE Id IN @result
```

**choose**

Use the `choose` function to extract only non-null values from each element in the sequence.

```
// Example

// Script Step

open Seq;  
  
let employees = [  
  { name: "Birgitta", location: null },  
  { name: "Comanche", location: "USA" },  
  { name: "Theodor", location: "Germany" }  
];  
  
return employees.choose(e => e.location);

// Output result should be : ["USA", "Germany"]
```

Assume that you have a database table \[dbo].\[Employees ] containing multiple Employees data. Now, we can use the **IN** clause to filter the values that we **choose** from the above sequence.

```
// Example

// Machine Step with a MS SQL database connector

SELECT *  
FROM  [dbo].[Employees ]
WHERE Location IN @result
```

Summary

* `map` → transforms values
* `collect` → flattens nested lists
* `choose` → filters out null values

All results can be directly used in `WHERE IN` clauses as parameterized list inputs.\ <br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.novacura.com/flow-connect/reference/how-to-guides/sql-list-parameter-support.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
