> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://mezmo.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://mezmo.ferndocs.com/_mcp/server.

# Compact Fields Processor

## [Description](https://docs.mezmo.com/docs/compact-fields-pipeline-processor#description)

Removes all nested fields recursively that contain empty arrays or objects from a specified field. This processor includes options to remove values from Arrays, and from Objects.

## [Use](https://docs.mezmo.com/docs/compact-fields-pipeline-processor#use)

This processor is particularly useful in cleaning up null values and other empty spaces within messages.

## [Configuration](https://docs.mezmo.com/docs/compact-fields-pipeline-processor#configuration)

There are two options to configure for this processor.

| **Option**          | **Description**                                                                 | Example  |
| ------------------- | ------------------------------------------------------------------------------- | -------- |
| **Fields**          | The field or fields to remove empty values from                                 | .        |
| **Compact Options** | Select to enable Compact for Arrays in the field, Objects in the field, or both | On / Off |

## [Example](https://docs.mezmo.com/docs/compact-fields-pipeline-processor#example)

### Before

```json
{
  "baz": [],
  "foo": "bar",
  "quux": {
    "corge": {},
    "grault": 1
  },
  "qux": {}
}
```

### Compact Options

| **Option**     | **Value** |
| -------------- | --------- |
| Field          | .         |
| Compact Array  | On        |
| Compact Object | On        |

### After

```json
{
  "foo": "bar",
  "quux": {
    "grault": 1
  }
}
```