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

# Key condition

> filter items where they key filter matches.

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

Keeps an item based on whether a particular key is present in the data. You choose a key check, such as "this key exists" or "this key does not exist", and point it at a path in the item. The item is kept when that check passes and filtered out when it does not. Use this for a quick presence test, for example "keep only records that have an email address".

This documentation describes: [Schema](/schemas/filter/key-condition)

## Fields

<FormField property="filter" label="Condition" required diType="key-filter">
  The key check that decides whether an item is kept. You pick the kind of check (for example "key exists" or "key does not exist") and the path it looks at.
</FormField>

## Sample data

This filter answers yes or no for each item, so there is no before and after. The example uses a "key exists" check on the `email` path, so it keeps only items that have an email.

| Field     | Value              |
| --------- | ------------------ |
| Condition | Key `email` exists |

| Incoming item                                   | Result         |
| ----------------------------------------------- | -------------- |
| `{ "name": "Acme", "email": "info@acme.test" }` | matches        |
| `{ "name": "Globex" }`                          | does not match |

```json Configuration theme={null}
{
  "prototype": "key-condition",
  "parameters": {
    "filter": {
      "prototype": "key-exists-condition",
      "parameters": { "path": "email" }
    }
  }
}
```
