---
schema_version: "1"
id: 8df68fd4682cd4aab7cc77dd3d958e08ff76c19ef406c2b8137471c15d1dd2dd
title: IsNullDefault()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/sites/mc-ampscript-reference-sites-is-null-default.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-sites/mc-ampscript-reference-sites-is-null-default.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: b782db07550090cd0f477b9357b20db2e58ed9068c2cbbd68cd7a26eeb4ffa4b
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# IsNullDefault()

Lets you create default values for empty fields in Smart Capture forms. This function is helpful for inserting data from Smart Capture forms into Data Extensions.

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>✅ Yes</td>
  </tr>
</table>

## Syntax

```
IsNullDefault(nonNullValue, nullValue)
```

The `IsNullDefault()` function has two parameters:

- `nonNullValue` (string): Required. The value to return when a Smart Capture form field isn’t null.
- `nullValue` (string): Required. The value to return when a Smart Capture form field is null.

## Usage

To use the function, pass the values that you want it to return if the field is filled or empty, respectively.

This example inserts data into a Data Extension based on input from a Smart Capture form.

```
%%[
  Var @formValue, @rewardsDataExt
  Set @formValue = IsNullDefault(RequestParameter("tier"), "Basic")

  Set @rewardsDataExt = CreateObject("Rewards Tier")
  SetObjectProperty(@rewardsDataExt, "Name", "tier")
  SetObjectProperty(@rewardsDataExt, "Value", @formValue)
  AddObjectArrayItem(@rewardsDataExt, "Properties", @formValue)
]%%
```

If the "tier" field in the Smart Capture form is filled, the example code inserts the value from the form. If the field is empty, the code inserts the value "Basic".
