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

# Remove values by condition

> Removes values from the data when they meet a specific set of conditions.

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

Drops values from your data, but only the ones that match a test you define. You pick which values to look at, then set one or more conditions; any value that meets all of them is removed, and everything else stays as it is. This is the tool for cleaning out unwanted entries, such as stripping out fields that are empty or removing prices that are zero.

This documentation describes: [Schema](/schemas/transformer/value-filter)

## Fields

<FormField property="accessor" label="Accessor" required diType="accessor">
  Selects which values the filter looks at. You choose how to point at the data, for example a single path like `product.price` or a pattern that matches many values at once. Every value it selects is then checked against your conditions.
</FormField>

<FormField property="conditions" label="Conditions" diType="condition">
  The tests a selected value must pass to be removed. A value is only removed when every condition you add is met; if any condition fails, the value is kept. With no conditions, every selected value is removed.
</FormField>

## Sample data

| Field      | Value                   |
| ---------- | ----------------------- |
| Accessor   | By pattern, pattern `*` |
| Conditions | Is empty                |

Input:

```json theme={null}
{
    "name": "Wool scarf",
    "color": "blue",
    "size": "",
    "material": null
}
```

Output:

```json theme={null}
{
    "name": "Wool scarf",
    "color": "blue"
}
```

The pattern selected every value, but only the empty `size` and the null `material` met the condition, so only those two were removed.

```json Configuration theme={null}
{
  "prototype": "value-filter",
  "parameters": {
    "accessor": { "prototype": "pattern", "parameters": { "pattern": "*" } },
    "conditions": [
      { "prototype": "empty" }
    ]
  }
}
```
