Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!