> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# By key

> Accesses values at the supplied keys.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Accesses values at the supplied keys. Use this when you want to read fields directly by name from a known spot in your data, such as picking the customer details out of an order. You point it at a base location and it reads the values that live directly underneath it, optionally narrowing the result to just the keys you list.

This documentation describes: [Schema](/schemas/accessor/key)

## Fields

<FormField property="root" label="Root">
  A dot-notated base path that tells the accessor where to look. The values directly under this path become available to read. Leave it empty to read from the top level of your data, or set it to, for example, `customer` to work with the fields inside the customer block.
</FormField>

<FormField property="keys" label="Keys">
  A list of keys that limits which values are returned. Leave it empty to return every value found under the base path.
</FormField>

## Sample data

| Field | Value                 |
| ----- | --------------------- |
| Root  | `customer`            |
| Keys  | `email`, `first_name` |

Input:

```json theme={null}
{
    "customer": {
        "first_name": "Anna",
        "last_name": "de Vries",
        "email": "anna@example.com",
        "newsletter": true
    }
}
```

Output:

```json theme={null}
{
    "first_name": "Anna",
    "email": "anna@example.com"
}
```

```json Configuration theme={null}
{
  "prototype": "key",
  "parameters": {
    "root": "customer",
    "keys": ["email", "first_name"]
  }
}
```
