# Set List Data

## Overview

![The Set List Data Node.](https://1553081948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU990HLHWA30dTfELtDUK%2Fuploads%2Fgit-blob-85de44ccf68761d28ace0f072ed2e113406c4bb4%2Fsetlistdatanode20241.png?alt=media)

The **Set List Data Node** allows the user to set the data of a [**List**](https://docs.incari.com/incari-studio/objects-and-types/scene2d-objects/gui/list) in a **Scene2D**.

This **Node** requires that the *JSON* data is in **Array** format. Refer to the [example](#example) at the bottom of the page.

[**Scope**](https://docs.incari.com/incari-studio/overview#scopes): **Scene**, **Function**, **Prefab**.

## Inputs

| Input             | Type         | Description                                                           |
| ----------------- | ------------ | --------------------------------------------------------------------- |
| *Pulse Input* (►) | **Pulse**    | A standard **Input Pulse**, to trigger the execution of the **Node**. |
| `Object ID`       | **ObjectID** | The **List** that the user wishes to set the data for.                |
| `List Data`       | **Array**    | The *JSON* list data in **Array** format.                             |

## Outputs

| Output             | Type      | Description                                                                                                                            |
| ------------------ | --------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| *Pulse Output* (►) | **Pulse** | A standard **Output Pulse**, to move onto the next **Node** along the **Logic Branch**, once this **Node** has finished its execution. |

## Example

For correct formatting, start with the desired *JSON* file. Here we have an example:

```
   [
    {
        "icon": "Users/user.name/Documents/Project1/Assets/image1.jpg",
        "text": "you collected"
    },
    {
        "icon": "Users/user.name/Documents/Project1/Assets/image2.png",
        "text": "over 9000"
    },
    {
        "icon": "Users/user.name/Documents/Project1/Assets/image3.png",
        "text": "overhours"
    }
]
```

This needs to be placed into an **Array**. Go into the **Logic Editor** and populate an **Array** with the elements of the desired *JSON* using your preferred method.

The full **Array** would look like this if outputted to the **Console**:

```
[ { icon:Users/user.name/Documents/Project1/Assets/image1.jpg, text:you collected }, { icon:Users/user.name/Documents/Project1/Assets/image2.png, text:over 9000 }, { icon:Users/user.name/Documents/Project1/Assets/image3.png, text:overhours } ]
```

![List Array Example.](https://1553081948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU990HLHWA30dTfELtDUK%2Fuploads%2Fgit-blob-f4c75f06526471bace0abb2c7925b052af0e19fb%2Flistarrayexample2.png?alt=media)

Each element is encapsulated by `{}` symbols, like in the *JSON*. The `""` are not necessary here. Simply use an A:B format with a comma separating the lines of each element.

The resulting **List** should look like this in the **Player**:

![Set List Output Example.](https://1553081948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FU990HLHWA30dTfELtDUK%2Fuploads%2Fgit-blob-74ad1aa80dc1a5179eb54e436a1d4be2dd2d3e0f%2Flistinplayerexample.png?alt=media)

## See Also

* [**Get List Data**](https://docs.incari.com/incari-studio/toolbox/incari/list2d/getlistdata)
