# split-list

## Description

<mark style="color:purple;">`split-list`</mark> *adaptor splits a list into two lists at the first instance of a specified separator value.*

## Inputs

**`list`**\
Type: `list`\
Required: Yes\
The list to be split.

**`separator`**\
Type: `text`\
Required: Yes\
The value at which the list is split.

**`append`**\
Type: `boolean`\
Required: No\
Whether to append the separator value to the first list. If unspecified, defaults to `False`.

**`prepend`**\
Type: `boolean`\
Required: No\
Whether to prepend the separator value to the second list. If unspecified, defaults to `False`.

## Outputs

**`first`**\
Type: `list`\
A list containing the values before the separator value.

**`second`**\
Type: `list`\
A list containing the values after the separator value.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`list`:

1. 100
2. 2
3. 1
4. 10
5. 200

`separator`: 1

`append`: *null(empty)*

`prepend`: *null(empty)*

#### Outputs:

`first`:

1. 100
2. 2

`second`:

1. 10
2. 200

-> Split a list into two based on the separator `1`.

### Example 2: Append separator value to the list.

#### Inputs:

`list`:

1. 100
2. 2
3. 1
4. 10
5. 200

`separator`: 1

`append`: *null(empty)*

`prepend`: True

#### Outputs:

`first`:

1. 100
2. 2
3. 1

`second`:

1. 10
2. 200

-> Split a list into two based on the separator `1` and appended the value.

### Example 3: Prepend separator value to the list.

#### Inputs:

`list`:

1. 100
2. 2
3. 1
4. 10
5. 200

`separator`: 1

`append`: *null(empty)*

`prepend`: True

#### Outputs:

`first`:

1. 100
2. 2

`second`:

1. 1
2. 10
3. 200

-> Split a list into two based on the separator `1` and prepended the value.


---

# Agent Instructions: 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:

```
GET https://cgps.gitbook.io/data-flo/reference-guide/split-list.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
