# prepend-to-list

## Description

<mark style="color:purple;">`prepend-to-list`</mark> *adaptor adds a single new value to the beginning of an existing list*.

If you wish to add a value to the end of a list, use the [<mark style="color:purple;">`append-to-list`</mark>](/data-flo/reference-guide/append-to-list.md) adaptor. If you wish to add multiple values, use the [<mark style="color:purple;">`append-lists`</mark> ](/data-flo/reference-guide/append-lists.md)adaptor.

## Inputs

**`list`**\
Type: `list`\
Required: Yes\
The list to which the value will be prepended.

**`value`**\
Type: `text`\
Required: Yes\
The value to be prepended to the list.

## Outputs

**`list`**\
Type: `list`\
A list with the value prepended.

## Examples

### Example 1: Default behaviour.

Inputs:

`list`:

1. green
2. blue

`value`:

1. red

#### Outputs:

`list`:

1. red
2. green
3. blue

-> Prepended value `red` to the existing list.

## Use Cases

* After using the [<mark style="color:purple;">`sort-list`</mark> ](/data-flo/reference-guide/sort-list.md)adaptor, add a missing element to the beginning of the list.
* Adding new values to lists allows for adjustment of included values without modifying the original dataset.


---

# 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/prepend-to-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.
