title: What is wrong with my JSON output for a Slack Message payload?
body: <p>I have set up what I think should be a working JSON output to send a message in slack but Slack keeps rejecting it.</p>
  
  <p>I have tried multiple different message layout formats using the guides on slack's api site, but so far the only method that has successfully sent is a fully flat JSON with no block formatting.</p>
  
  <pre><code>function submitValuesToSlack(e) {
  
    var name = e.values[1];
    var caseNumber = e.values[2];
    var problemDescription = e.values[3];
    var question = e.values[4];
    var completedChecklist = e.values[5];
  
    var payload = [{
      "channel": postChannel,
      "username": postUser,
      "icon_emoji": postIcon,
      "link_names": 1,
      "blocks": [
        {
          "type": "section",
          "fields": [
            {
              "type": "mrkdwn",
              "text": "*Name:*\n " + name
            }
          ]
        }]
    }];
    console.log(JSON.stringify(payload, null, "\t"));
  
    var options = {
      'method': 'post',
      'payload': JSON.stringify(payload)
    };
  
    console.log(options)
  
    var response = UrlFetchApp.fetch(slackIncomingWebhookUrl, options);
  
  }
  </code></pre>
  
  <p>When I run this, I get the following output:</p>
  
  <pre><code>[  
     {  
        "channel":"#tech-support",
        "username":"Form Response",
        "icon_emoji":":mailbox_with_mail:",
        "link_names":1,
        "blocks":[  
           {  
              "type":"section",
              "fields":[  
                 {  
                    "type":"mrkdwn",
                    "text":"*Name:*\n test"
                 }
              ]
           }
        ]
     }
  ]
  </code></pre>
  
  <p>Which I believe is correct, however slack api just rejects it with an HTTP 400 error "no text"</p>
  
  <p>am I misunderstanding something about block formatting?</p>
  
  <p>EDIT:</p>
  
  <p>To Clarify, formatting works if I use this for my JSON instead of the more complex format:</p>
  
  <pre><code>{  
        "channel":"#tech-support",
        "username":"Form Response",
        "icon_emoji":":mailbox_with_mail:",
        "link_names":1,
        "text":"*Name:*\n test"
  }
  </code></pre>