Home Explore Blog CI



nushell

commands/docs/items.md
636797dd5804ca92517e6fc7e503a841c48dff01eeec80280000000300000470
---
title: items
categories: |
  filters
version: 0.104.0
filters: |
  Given a record, iterate on each pair of column name and associated value.
usage: |
  Given a record, iterate on each pair of column name and associated value.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `items` for [filters](/commands/categories/filters.md)

<div class='command-title'>Given a record, iterate on each pair of column name and associated value.</div>

## Signature

```> items {flags} (closure)```

## Parameters

 -  `closure`: The closure to run.


## Input/output types:

| input  | output |
| ------ | ------ |
| record | any    |
## Examples

Iterate over each key-value pair of a record
```nu
> { new: york, san: francisco } | items {|key, value| echo $'($key) ($value)' }
╭───┬───────────────╮
│ 0 │ new york      │
│ 1 │ san francisco │
╰───┴───────────────╯

```

## Notes
This is a the fusion of `columns`, `values` and `each`.

Chunks
7d4527ad (1st chunk of `commands/docs/items.md`)
Title: items Command in Nushell
Summary
The `items` command in Nushell iterates over each key-value pair (column name and associated value) of a record and applies a given closure to each pair. It is effectively a combination of the `columns`, `values`, and `each` commands.