The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I am trying to follow the example from this page about sending a post request to a Teams webhook, and then I want to send a portion of that text to a Teams channel. The code and workflow I am using is below.
https://learn.microsoft.com/en-us/connectors/teams/?tabs=text1%2Cdotnet#microsoft-teams-webhook
const formatted_Card_Payload = {
"method": "POST",
"type":"message",
"attachments":[{
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content":{
"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
"type":"AdaptiveCard",
"version":"1.2",
"body":[{
"type": "TextBlock",
"text": "does this work?"
}
]
}
}
]
}
fetch(TEAMS_WEBHOOK_URL, formatted_Card_Payload)
I keep getting the error below, and I am not sure how to resolve it.
The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerBody()?['attachments']' is of type 'Null'. The result must be a valid array.
I have been stumped on this issue all week, and I'm sure the fix is something super obvious