Unable to send message to MS Teams

I built a workflow is to send a Message which includes a line of text and three images. The workflow is as attached in the screenshot.


The message I am sending via adaptive card:

{

   "type":"AdaptiveCard",

   "body":[

      {

         "type":"TextBlock",

         "text":"Please find the health..."

      },

      {

         "type":"Image",

         "url":"https://tm365.sharepoint.com/sites/ROBIN/Shared%20Documents/09-%20Projects%20Storage/GITD-0081-03/Screenshot-Temp/Zabbix.jpeg",

         "size":"Medium"

      },

      {

         "type":"Image",

         "url":"https://tm365.sharepoint.com/sites/ROBIN/Shared%20Documents/09-%20Projects%20Storage/GITD-0081-03/Screenshot-Temp/Dynatrace.jpeg",

         "size":"Medium"

      }

   ]

}

While executing, the workflow hit an exception at Send Channel Message. The following was the error message:

Send Channel Message: Request failed with error:

RequestId : 69c21585e4b072f2e2de9b4c

Message : You need to pass either Message body or Adaptive card JSON or Image or Sharepoint file IDs
and here are the dependencies that I am using:

“dependencies”: {
“UiPath.Excel.Activities”: “[2.24.4]”,
“UiPath.IntegrationService.Activities”: “1.23.0”,
“UiPath.Mail.Activities”: “[1.24.14]”,
“UiPath.MicrosoftOffice365.Activities”: “[3.7.10]”,
“UiPath.System.Activities”: “25.12.2”,
“UiPath.Testing.Activities”: “[24.10.4]”,
“UiPath.UIAutomation.Activities”: “[24.10.12]”,
“UiPath.WebAPI.Activities”: “2.4.0”

Please help me in identifying the error and please tell me how to fix it. Thanks.

Status code: BadRequest. Error code: DAP-RT-1101.
Post_Msg_and_Scrshot_To_Teams.xaml (51.9 KB)

@RobinsonFrancis

can you pring the json and check if the format is proper ..we need to parse it as mentioned it activity before passing

also can you show other properties as well

also in_adaptive_json is it not a string?..

cheers

A couple of checks can narrow this down quickly:

  1. Make sure the variable is connected to the activity’s Adaptive card JSON property, not the normal Message body property. It should be a String. If you build it as a JObject, pass jObject.ToString(Newtonsoft.Json.Formatting.None).
  2. Test with a minimal card first:

{
“$schema”: “http://adaptivecards.io/schemas/adaptive-card.json”,
“type”: “AdaptiveCard”,
“version”: “1.4”,
“body”: [
{ “type”: “TextBlock”, “text”: “UiPath test” }
]
}

If that posts successfully, the activity mapping and connection are fine; add the images one at a time.

The SharePoint links in the example are another likely issue. An Adaptive Card image URL must be directly reachable by Teams. A normal SharePoint document URL may require an interactive login and therefore cannot be downloaded by the card renderer. Use an appropriate direct/shared URL that the Teams user can access, or upload/attach the files through the activity and use the SharePoint file IDs if that option fits the connector.

Also log the final string immediately before Send Channel Message and paste it into the Adaptive Cards Designer. That will catch missing commas, escaped quotation marks, or a variable that is empty at runtime. The current error usually means the activity received an empty or unmapped input, so I would verify the property binding before changing package versions.