Home Explore Blog CI



nushell

commands/docs/into_record.md
4ea3aac00dac44cfd8dc309269716582c2c5b369df6a94980000000300000962
---
title: into record
categories: |
  conversions
version: 0.104.0
conversions: |
  Convert value to record.
usage: |
  Convert value to record.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `into record` for [conversions](/commands/categories/conversions.md)

<div class='command-title'>Convert value to record.</div>

## Signature

```> into record {flags} ```


## Input/output types:

| input     | output |
| --------- | ------ |
| datetime  | record |
| duration  | record |
| list\<any\> | record |
| record    | record |
## Examples

Convert from one row table to record
```nu
> [[value]; [false]] | into record
╭───────┬───────╮
│ value │ false │
╰───────┴───────╯
```

Convert from list of records to record
```nu
> [{foo: bar} {baz: quux}] | into record
╭─────┬──────╮
│ foo │ bar  │
│ baz │ quux │
╰─────┴──────╯
```

Convert from list of pairs into record
```nu
> [[foo bar] [baz quux]] | into record
╭─────┬──────╮
│ foo │ bar  │
│ baz │ quux │
╰─────┴──────╯
```

convert duration to record (weeks max)
```nu
> (-500day - 4hr - 5sec) | into record
╭────────┬────╮
│ week   │ 71 │
│ day    │ 3  │
│ hour   │ 4  │
│ second │ 5  │
│ sign   │ -  │
╰────────┴────╯
```

convert record to record
```nu
> {a: 1, b: 2} | into record
╭───┬───╮
│ a │ 1 │
│ b │ 2 │
╰───┴───╯
```

convert date to record
```nu
> 2020-04-12T22:10:57+02:00 | into record
╭─────────────┬────────╮
│ year        │ 2020   │
│ month       │ 4      │
│ day         │ 12     │
│ hour        │ 22     │
│ minute      │ 10     │
│ second      │ 57     │
│ millisecond │ 0      │
│ microsecond │ 0      │
│ nanosecond  │ 0      │
│ timezone    │ +02:00 │
╰─────────────┴────────╯
```

convert date components to table columns
```nu
> 2020-04-12T22:10:57+02:00 | into record | transpose | transpose -r

```

Chunks
9e7f2953 (1st chunk of `commands/docs/into_record.md`)
Title: into record
Summary
The `into record` command in Nushell converts various data types (datetimes, durations, lists, and records) into a record format. The provided examples demonstrate how to convert data from tables, lists of records/pairs, durations, dates, and existing records into a record format, showcasing the structure of the resulting records.