---
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: firstNonNull (object1, objectN)
layout: subsection
---

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

Returns the first object that isn't null. Often used to check different data sources for the first result. Returns null if all given objects are empty.

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

`Object`

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

```
object:firstNonNull(object1, objectN)
```

<table><thead><tr><th>Parameter</th><th>Description</th></tr></thead><tbody><tr><td>object1, objectN</td><td>A set of comma-delimited objects</td></tr></tbody></table><br/>

<b>Example</b>

`object:firstNonNull(mySurvey.answer1 , mySurvey.answer2)`

Assuming `mySurvey.answer1` is null and `mySurvey.answer2` contains 'my first dog', the result is `'my first dog'`.

