# FAQ: How do I assign a default value to fields that have null or blank values?

**URL:** https://connective.celigo.com/t/faq-how-do-i-assign-a-default-value-to-fields-that-have-null-or-blank-values/1263
**Category:** Integrator.io
**Tags:** export, assigning, handlebars
**Created:** [January 13, 2021, 9:07pm UTC](https://connective.celigo.com/t/faq-how-do-i-assign-a-default-value-to-fields-that-have-null-or-blank-values/1263 "2021-01-13T21:07:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tomsantiago](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tomsantiago/32/7158_2.png) [@tomsantiago](https://connective.celigo.com/u/tomsantiago)
#### Post date: [January 13, 2021, 9:07pm UTC](https://connective.celigo.com/t/faq-how-do-i-assign-a-default-value-to-fields-that-have-null-or-blank-values/1263/1 "2021-01-13T21:07:37Z")

</div>

If an object in a record from your export data contains no value, you can use the if/else handlebar block helper to assign a default value.

The following expression checks the object/value pair. If the value exists, it prints the value. If the object has an empty value or the object/value pair isn't present in the export data, you can print a default value (e.g. null).   
The statement uses this syntax:

```
{{#if value}}{{value}}{{else}}null{{/if}}
```

For more information, see [if/else](https://docs.celigo.com/hc/en-us/articles/360039326071#if_else).

---

<div class="post-metadata">

### Author: ![romelrobles](https://avatars.discourse-cdn.com/v4/letter/r/4bbf92/32.png) [@romelrobles](https://connective.celigo.com/u/romelrobles)
#### Post date: [January 13, 2022, 3:41pm UTC](https://connective.celigo.com/t/faq-how-do-i-assign-a-default-value-to-fields-that-have-null-or-blank-values/1263/2 "2022-01-13T15:41:41Z")

</div>

Hi @tomsantiago

how about if the export value is an empty string, how could I do it that it will print a black value?

I tried to replace it with a "space" but it still not accepting it.

---

<div class="post-metadata">

### Author: ![deleted.user](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@deleted.user](https://connective.celigo.com/u/deleted.user)
#### Post date: [January 13, 2022, 5:50pm UTC](https://connective.celigo.com/t/faq-how-do-i-assign-a-default-value-to-fields-that-have-null-or-blank-values/1263/3 "2022-01-13T17:50:10Z")

</div>

Hi Romel,

This might be dependent on what the destination (import) record will accept as an empty value. In your example, a space could be considered as a character. You might try instead to omit the space character.

For instance, instead of the following, which contains a space chararcter for the #if statement:

```
{{#if value}}{{value}}{{else}} {{/if}}
```

you might instead try this, which omits the space:

```
{{#if value}}{{value}}{{else}}{{/if}}
```

If you're using the default mapping tool, you may need to open the advanced options next to the field you're mapping to (the 'gear' icon), and check the "Discard if empty" option as well.

 ![5301043caa20740200000001-f4264aa8724f406f8b446fde6b22ebd3.png](https://us1.discourse-cdn.com/flex001/uploads/celigo/original/2X/1/1ee18f075ec2057c7d90e5bb6af6fe2ca7068727.png)

Best Regards,

Dan
