> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mezmo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Compact Fields Processor

> Recursively remove empty arrays and objects from a specified field to clean up null values and empty spaces in messages.

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

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

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

### Before

```json theme={null}
{
  "baz": [],
  "foo": "bar",
  "quux": {
    "corge": {},
    "grant": 1
  },
  "quick": {}
}

```

### Compact Options

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

### After

```json theme={null}
{
  "foo": "bar",
  "quux": {
    "grant": 1
  }
}

```
