> For the complete documentation index, see [llms.txt](https://docs.airops.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.airops.com/actions/workflow-concepts/workflow-steps/logic-steps/format-single-multi-select.md).

# Format Single/Multi Select

Turn a list of objects into JSON or CSV options for Single Select and Multi Select Grid columns.

## How does the Format Single/Multi Select Step work?

Use **Format Single/Multi Select** to turn a list of objects into labels and stored values. For example, convert a list of CMS authors into readable names paired with author IDs, then use the result when configuring Grid options.

The Step returns a JSON object or CSV text. When it is the final Step, the Workflow returns the complete formatted result in one Grid output column.

## How to Configure a Format Single/Multi Select Step

1. Add **Format Single/Multi Select** from **Code** after the Step that produces your list.
2. In **Select JSON output**, choose the source list. Test the source Step to make its output available for preview.
3. Set **Label field** to the object field containing the display label, such as `name`.
4. Set **Value field** to the field containing the stored value, such as `id`. Both field settings support variables.
5. Choose **JSON (label to value)** or **CSV (label,value per line)** under **Output format**. JSON is the default.
6. Review **Options preview**, then test the Step.

<figure><img src="https://3762890407-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FX2n5yPRPynbnWuO4SH0M%2Fuploads%2Fgit-blob-debb845904eaa466e83c00da1e972ffcd13d0af2%2Fformat-select-01-options-preview.png?alt=media" alt="Format Single/Multi Select step with label and value fields and an options preview of three ground stations"><figcaption><p>Map label and value fields, then check the options preview.</p></figcaption></figure>

| Parameter              | What to provide                                                           |
| ---------------------- | ------------------------------------------------------------------------- |
| **Select JSON output** | An array of objects from an earlier Step or Input.                        |
| **Label field**        | The key to use for each option's display label.                           |
| **Value field**        | The key to use for each option's stored value.                            |
| **Output format**      | A JSON label-to-value object or CSV with one pair per line and no header. |

Labels and values must be nonempty text or numbers. The Step trims surrounding whitespace, converts numbers to strings, and rejects duplicate labels or duplicate values.

## Example

Given this source list:

```json
[
  {"name": "Aaron", "id": 93},
  {"name": "Alice", "id": 22}
]
```

Set **Label field** to `name` and **Value field** to `id`. JSON output is:

```json
{
  "Aaron": "93",
  "Alice": "22"
}
```

CSV output is:

```csv
Aaron,93
Alice,22
```

The formatter prepares the data. To change a populated Grid data column into a dropdown, use the separate [column conversion flow](https://docs.airops.com/actions/grids/add-columns-in-the-grid.md#convert-a-populated-column-to-single-select-or-multi-select).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.airops.com/actions/workflow-concepts/workflow-steps/logic-steps/format-single-multi-select.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
