Edit: nevermind, I figured it out
With the upcoming deprecation of Teams connectors, I've been working on turning our old Webhook alerts into Power Automate flows. I'm having an issue converting our old Graylog Teams notifications.
Grayload sends a JSON payload to a "Request - When an HTTP request is received" trigger. That JSON payload looks like this:
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"themeColor": "#FF0000",
"text": "**Alert Event Definition Test Title triggered:**\n",
"summary": "Event Definition Test Title",
"sections": [
{
"activitySubtitle": "_Event Definition Test Description_",
"activityImage": "",
"text": ""
}
]
}
When I input the body from that trigger to a "Post card in a chat or channel" action, I get an error message saying that "@type" needs to be set to "AdaptiveCard"
I've tried parsing the payload with a "Data Operation - Parse JSON" action and then a "Data Operation - Compose" action with setproperty() to change the value. The problem is it moves "@type" to the bottom of the JSON and then the card posts into the Teams channel is blank.
How can I modify that value without reordering the JSON? Or is there another way to accomplish my goal here?
Categories: