# Edit In List Block

## Edit List Blocks

These all apply to the `insert at` option aswell.

## Set In List Block

![Set In List](/files/-LNixDNZsvncsuztzSXF)

The set in list block sets the item in the list with the specified index to the specified value.

### Generated Code

```javascript
var list;

list[index] = <value>;
```

## Set In List From End Block

![Set In List From End](/files/-LNixDNaQSzgGG2E7k-x)

The set in list from end block sets the item in the list with the specified index from the end to the specified value.

### Generated Code

```javascript
var list;

list[list.length - <index>] = <value>;
```

## Set First In List Block

![Set First In List](/files/-LNixDNcL-0zS3qpLvge)

The set first in list block sets the first item in the list to the specified value.

### Generated Code

```javascript
var list;

list[0] = <value>;
```

## Set Last In List Block

![Set Last In List](/files/-LNixDNe3rcP4ORhB-Pb)

The set last in list block sets the last item in the list to the specified value.

### Generated Code

```javascript
var list;

list[list.length - 1] = <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://docs.discorddungeons.me/quest-editor/list-blocks/edit_in_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.
