'How to remove null (empty) JSON response from webhook endpoint to be stored in database?

I created this JSON snippet to pass data using webhook and endpoint from one database to another:

{
    "Subscribers": [
        {
            "EmailAddress": "[email]",
            "CustomFields": [
                {
                    "FieldName": "Source",
                    "Value": "[source]"
                },
                {
                    "FieldName": "Campaign",
                    "Value": "[campaign]"
                },
                {
                    "FieldName": "Medium",
                    "Value": "[medium]"
                }
            ],
            "Lists": [
                200468800
            ]
        }
    ]
}

If for example field [email] returns null how can I skipt this, so that webhook don't create null string entry in database?

Thank you...



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source