'Slack webhook doesn't accept a JSON payload with a block that has an empty string

I am trying to set up an integration between Zendesk and Slack, where Zendesk sends new notifications to Slack using Slack's Incoming Webhooks. The issue is that under certain circumstances, some Zendesk fields would be empty strings, which are flagged by slack as an invalid_payload. I would love to be able to send the message with an empty string, or at least have a fallback string if the zendesk field is empty.

I have confirmed that populating the empty string, without making any other changes to the payload, results in a successful integration, so it's definitely the empty string blocking the message from being delivered. I have also found this SO thread, but this doesn't seem to work for me. I haven't been able to find any documentation from slack regarding empty strings in the JSON payload either.

So I guess my question is whether or not it's possible to send empty strings in a JSON payload for Slack webhooks at all, and if not, is there a workaround to account for the possibility of an empty string? As I mentioned, this is a Zendesk integration so I don't have the ability to write a script to check for an empty string because it's all happening within Zendesk's dashboard (at least as far as I'm aware).

Here's the overall JSON object that I am trying to send from Zendesk to Slack. The Organization field is the one that has the potential to be blank:

{
    "blocks": [
        {
            "type": "divider"
        },
        {
            "type": "header",
            "text": {
                "type": "plain_text",
                "text": "Ticket Title/Subject"
            }
        },
        {
            "type": "context",
            "elements": [
                {
                    "type": "mrkdwn",
                    "text": "*Ticket #_000_*"
                }
            ]
        },
        {
            "type": "context",
            "elements": [
                {
                    "type": "mrkdwn",
                    "text": "*Status: _New_*"
                }
            ]
        },
        {
            "type": "section",
            "fields": [
                {
                    "type": "mrkdwn",
                    "text": "*Requester*"
                },
                {
                    "type": "mrkdwn",
                    "text": "*Organization*"
                },
                {
                    "type": "plain_text",
                    "text": "Client Name"
                },
                {
                    "type": "plain_text",
                    "text": "Organization Name" //Possible empty string
                }
            ]
        },
        {
            "type": "section",
            "text": {
                "type": "plain_text",
                "text": "Message Body Text Here"
            }
        },
        {
            "type": "divider"
        }
    ]
}


Sources

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

Source: Stack Overflow

Solution Source