How to return blank rather than "null"?

I’m generating an array of phone number like the following:

{
"phones": [
          {
            "phoneNumber": "694-440-4539",
            "phoneType": "FAX",
            "extension": "1234"
          },
          {
            "phoneNumber": "412-450-4989",
            "phoneType": "FAX",
            "extension": null
          }
        ]
}

I’ve set the field to generate blanks 70% of the time; however, rather than being blank, I’m getting ‘null’. How do I fix that?

Use the inline formula (the f(x) button) to replace nil with “”.

if this.nil? then "" else this end

Hasn’t worked for me.

Here’s my field field defintion

{
    "field": {
        "name": "phones.extension",
        "type": "Regular Expression",
        "regEx": "\d{4}",
        "formula": "if this.nil? then '' else this end"
    }
}

Ah, I see what’s going on. When a blank is generated it skips the inline formula. You can get around this by making two fields: A hidden source field (hide any field by naming it starting with “__”) and a formula field to convert nils in the source field to blank strings.