> ## 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: Diff values

> Returns the values present in the input but not in the supplied data.

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 keep only the values that appear in the input but are missing from a reference set you supply. Think of it as a subtraction: the input is your starting set, and any value that also exists in the supplied data is removed from it. This is handy for finding new or extra values, for example which tags on a product are not already in an approved list. The comparison is on the values themselves, not the keys, and the kept entries keep their original positions.

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

## Fields

<FormField property="array" label="Data" required>
  The reference values to subtract, entered directly as a small block of data in the form. Any value in the input that also appears here is dropped from the result; everything else is kept. Only the values matter for the comparison, so the keys you give them here are not important.
</FormField>

## Sample data

This example removes a couple of known tags from a product's tag list, keeping only the ones that are not in the supplied set.

| Field | Value                               |
| ----- | ----------------------------------- |
| Data  | `{ "a": "sale", "b": "clearance" }` |

Input:

```json theme={null}
["summer", "sale", "outdoor", "clearance"]
```

Output:

```json theme={null}
{
    "0": "summer",
    "2": "outdoor"
}
```

`sale` and `clearance` are removed because they appear in the supplied data. The kept values hold on to their original positions (`summer` was first, `outdoor` was third), which is why the result is numbered `0` and `2` rather than renumbered from scratch.

```json Configuration theme={null}
{
  "prototype": "list-diff",
  "parameters": {
    "array": { "a": "sale", "b": "clearance" }
  }
}
```
