# Inject Item

### What It Does

Adds a single item into a list at a specific position. Unlike push which adds to the end, this allows you to insert an item anywhere in the list.

### Inputs

| Name  | Description                        | Type   | Required |
| ----- | ---------------------------------- | ------ | -------- |
| array | The original list                  | List   | Yes      |
| item  | The item to insert into the list   | Any    | Yes      |
| index | The position to insert the item at | Number | Yes      |

### Outputs

| Name  | Description                      | Type |
| ----- | -------------------------------- | ---- |
| array | The list with the new item added | List |

![Inject Item Example](https://3657049418-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy0SFXZjN1sdgdxYM7QPE%2Fuploads%2FUnOUPpesIv3cC5tpqrca%2FScreenshot%202025-04-17%20at%206.18.42%E2%80%AFPM.png?alt=media\&token=807c4f80-66e3-4967-99ba-323e2b8baa15)

### How to Use It

1. Drag the Inject Item node into your graph.
2. Connect your list (like `[16, 24]`) to the "array" input.
3. Connect the item to insert (like `15`) to the "item" input.
4. Set the "index" value (e.g., 1 to insert between the first and second items).

<figure><img src="https://3657049418-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy0SFXZjN1sdgdxYM7QPE%2Fuploads%2FXCufEZN1xdbAKbHSoaWy%2FCleanShot%202025-05-06%20at%2013.23.12%402x.png?alt=media&#x26;token=d2081321-f8ed-43d5-b674-6a1622eddeac" alt=""><figcaption></figcaption></figure>

### Tips

* Use index 0 to insert at the beginning of the list.
* You can use negative indexes to count from the end (-1 inserts before the last item).

### See Also

* [**Array Push**](https://documentation.tokens.studio/graph-engine/available-nodes/array/push): For adding items to the end of an array.
* [**Replace**](https://documentation.tokens.studio/graph-engine/available-nodes/string/replace): For replacing existing items rather than inserting new ones.

### Use Cases

* **Color Palette Refinement**: Insert a transitional color between existing shades at a specific position.
* **Priority Insertion**: Add a new high-priority item in the middle of an existing sequence.
* **Layered Structure Design**: Insert elements between existing layers in a design structure.
