1
votes

I have a webhook setup to post a message to one of our Teams Team channels. I'm using one of the teams webhook examples given here: https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-reference#hero-card .

The problem I have is that I am unable to display multiple lines. In the example below, I'd like to separate out 'Test1' and 'Test2' on separate lines. However, using \n or \n in the JSON didn't translate to multi line format in Teams. Screenshot outcome attached below.

    "type": "message",
    "attachments": [
        {
            "contentType": "application/vnd.microsoft.card.hero",
            "content": {
                "title": "Alerts",
                "text": "*Test1 \n *Test\n",
                "buttons": [
                    {
                        "type": "openUrl",
                        "title": "Open in SumoLogic",
                        "value": ""
                    }
                ]
            }
        }
    ]
}

What is the way to send a multi-line message to Teams using webhook? Any guidance here is appreciated.

how the result in teams look like at the moment

1

1 Answers

1
votes

Please try using \n\n and check.