Open jentrup346734 opened 3 months ago
Hi jentrup346734! Thank you for bringing this issue to our attention. We will investigate and if we require further information we will reach out in one business day. Please use this link to escalate if you don't get replies.
Best regards, Teams Platform
Thank you for reporting this, we will check this and get back to you.
@jentrup346734 Looks like the json format you are using is for old connector format. Since you are using a workflow you should be following the json format for the adative cards : just below the curl / powershell section, here.
The "Send_each_adaptive_card" of the workflow requires the "attachments" parts filled as an adaptive card, which is not present in your original json and hence the error.
@vivekk0903 Yes that is accurate, however we still need the documentation updated as the documentation is incorrect when using the new workflows.
@jentrup346734 - We have shared the feedback with engineering team to update the documentation with examples for workflows.
Steps to reproduce
This page https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using?tabs=PowerShell%2Ctext1#send-messages-using-curl-and-powershell
PowerShell section suggests using this code to post message using webhook suggested by Microsoft to replace incoming webhook connector. Workflow template called "Post to a channel when a webhook request is received"
Expected behavior
Execute below with appropriate URI Invoke-RestMethod -Method post -ContentType 'Application/Json' -Body '{"text":"Hello World!"}' -Uri
Expected to post "Hello World!" in channel
Actual behavior
Power Automate flow fails with error
Error details
Action 'Send_each_adaptive_card' failed: The execution of template action 'Send_each_adaptive_card' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body']?['attachments']' is of type 'Null'. The result must be a valid array.