> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://mezmo.ferndocs.com/flatten-fields-processor/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://mezmo.ferndocs.com/_mcp/server. # Flatten Fields Processor ## [Description](https://docs.mezmo.com/docs/flatten-field-pipeline-processor#description) This processor recursively reduces the level of a set of objects and appends the prior level to the keys of each. ## [Use](https://docs.mezmo.com/docs/flatten-field-pipeline-processor#use) The flatten processor is useful when you need all nested fields of a JSON object to be moved to a single level. This can be beneficial when integrating with a system that can't handle complex or nested data. ## [Configuration](https://docs.mezmo.com/docs/flatten-field-pipeline-processor#configuration) There are two options for configuring this processor. | **Option** | **Description** | **Example** | | ------------------- | ------------------------------------------------------------------------------- | ----------- | | **Fields** | The field or fields to flatten. | `.foo` | | **Flatten Options** | Specify the delimiter to use for combining field names with the flattened data. | \_ | ## [Example](https://docs.mezmo.com/docs/flatten-field-pipeline-processor#examples) ### Before ```json { "foo": { "bar": { "baz": 1, "qux": "quux" }, "corge": [ 1, 2, 3 ] } } ``` ### Flatten Options | Option | Value | | ------------- | ------ | | **Field** | .`foo` | | **Delimiter** | \_ | ```json { "foo_bar_baz": 1, "foo_bar_qux": "quux", "foo_corge": [ 1, 2, 3 ] } ```