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
Marketing Cloud Engagement
✅ Yes
Marketing Cloud Next
❌ No
Syntax
1IsNullDefault(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.
1%%[2 Var @formValue, @rewardsDataExt3 Set @formValue = IsNullDefault(RequestParameter("tier"), "Basic")45 Set @rewardsDataExt = CreateObject("Rewards Tier")6 SetObjectProperty(@rewardsDataExt, "Name", "tier")7 SetObjectProperty(@rewardsDataExt, "Value", @formValue)8 AddObjectArrayItem(@rewardsDataExt, "Properties", @formValue)9]%%
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”.