> ## 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.

# Array or object: Count items

> Returns the number of items in an array or the number of keys in an object.

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>;
};

Use this mapper to find out how many entries something contains. Given a list it returns the number of items; given a keyed object it returns the number of keys. The result is a single whole number, which is useful for things like recording how many lines an order has or how many images a product carries.

This documentation describes: [Schema](/schemas/mapper/list-count)

## Fields

This mapper has no settings to fill in. It always counts whatever value it receives.

## Sample data

This example counts the lines on an order.

Input:

```json theme={null}
[
    { "sku": "SCARF-01" },
    { "sku": "BELT-02" },
    { "sku": "HAT-03" }
]
```

Output:

```json theme={null}
3
```

A keyed object such as `{ "color": "red", "size": "M" }` returns `2`, the number of keys, and an empty list returns `0`.

```json Configuration theme={null}
{
  "prototype": "list-count",
  "parameters": {}
}
```
