---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, PMD Scripting, Scripts]
nav: wcp_docs
parent_url: /wcp_docs/
title: excludeEmptyAttribute (list, key)
layout: subsection
---

## <a id="section_m3p_myb_5db"></a>Description

Given a list of objects, excludes the objects that don't contain an attribute with the given key. If an object doesn't contain an attribute value that matches the given key, `excludeEmptyAttribute` treats that attribute as an empty attribute. `excludeEmptyAttribute` excludes an object with an empty attribute from the returned list.

## <a id="section_cyq_j1m_zsb"></a>Return Type

`List`

## <a id="section_dz5_pwg_5db"></a>Namespace Function Syntax

```
list:excludeEmptyAttribute(list, key)
```

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>list</td><td>A map list of Objects</td></tr><tr><td>key</td><td>An attribute key to find</td></tr></tbody></table><br/>

<b>Example</b>

Assume <i>theList</i> is <i>[{"key0": "value0"}, {"key0": "value1"}, {"key2", "value2"}]</i>.

`list:excludeEmptyAttribute(theList, 'key0')`

Because the object <i>{"key2", "value2"}</i> doesn't contain an attribute whose key matches <i>key0</i>, `excludeEmptyAttribute` excludes <i>{"key2", "value2"}</i> from this returned list.

```
[{'key0': 'value0'}, {'key0', 'value1'}]
```

