web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Post to a Teams Channe...
Power Automate
Unanswered

Post to a Teams Channel - why so complicated?

(2) ShareShare
ReportReport
Posted on by 3

Hi, I had a couple of webhooks configured in teams with 365 connectors. Now I'm forced to switch to Workflows. At first look the change doesn't seems too big - instead of Webhook URL I now need to generate Workflow URL. However, till now the following simple code worked 

$json_formated_body = @"
{
"text": "$($body | out-string)"
}
"@

Invoke-RestMethod -Method post -Body $json_formated_body -Uri $webhook_url -ContentType 'Application/Json' and now when I replace the old webhook_url with the new wokflow_url I'm getting an error in the workflow log: ErrorAction 'Send_each_adaptive_card' failed Error Details- The execution of template action 'Send_each_adaptive_card' failed: the result of the evaluation of 'foreach' expression '@triggerBody()?['body']?['attachments']' is of type 'Null'. The result must be a valid array.

The workflow is a simple "Post to a channel when a webhook request is received" Flow without any modifications. 
Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard