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

# filter_empty_values

Recursively filters out empty values from nested objects and arrays.

This function removes the following empty values:

* `None` values
* Empty strings (after trimming whitespace)
* Empty lists
* Empty dictionaries
* Lists and dictionaries that become empty after filtering their contents

```python theme={null}
def filter_empty_values(
    data: T,
) -> T
```

## Examples

```python Basic Usage theme={null}
from typing import TypedDict
from playwright.async_api import Page
from intuned_browser import filter_empty_values
class Params(TypedDict):
    pass
async def automation(page: Page, params: Params, **_kwargs):
    # Filter empty values from dictionary
    result1 = filter_empty_values({"a": "", "b": "hello", "c": None})
    # Output: {"b": "hello"}
    print(result1)
    # Filter empty values from list
    result2 = filter_empty_values([1, "", None, [2, ""]])
    # Output: [1, [2]]
    print(result2)
    # Filter nested structures
    result3 = filter_empty_values({"users": [{"name": ""}, {"name": "John"}]})
    # Output: {"users": [{"name": "John"}]}
    print(result3)
    return "All data filtered successfully"
```

## Arguments

**data** `T` *required*

The data structure to filter (dict, list, or any other type)

## Returns: `T`

Filtered data structure with empty values removed


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.