# 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".
