---
title: "Action generate_list"
description: "Builds a UI list from an array in constants and stores it in another constant."
---

# Action `generate_list`

> **System ID:** `action_generate_list`

## Description

Takes an array from user constants, converts it into a list structure (`total`, `value`, `list` with `text` / `value` fields), and stores the result in the specified constant. Suitable for dropdowns and selection in a scenario. Optional `mapping` defines which object fields to use for the label and value.

## Events (scenario branches)

No events (the action completes without a branch). If `list` / `output` is missing or the array is not found — also no branch (silent failure).

## Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `list` | string | yes | — | Path (dot-notation) to the array in constants, e.g. `products.list` |
| `output` | string | yes | — | Constant name to store the formatted list |
| `mapping` | object | no | `null` | Field mapping: `text` and/or `value` (paths within the array item) |

## Configuration example

```json
{
  "list": "products.list",
  "output": "formatted_products",
  "mapping": {
    "text": "name",
    "value": "id"
  }
}
```

## Related docs

- [Actions reference](/en/actionjail/reference/actions-reference.md)
