Error while posting to MS Teams using Send Channel Message

I am trying to upload 3 images to sharepoint and then later use the IDs of the Images uploaded as input for the “Send Channel Message” as shown below.


This is the properties of it

This is my xaml:
Upload_and_Post_To_MS_Teams.xaml (43.0 KB)
These are my dependencies:
“dependencies”: {
“UiPath.Excel.Activities”: “[2.24.4]”,
“UiPath.IntegrationService.Activities”: “[1.24.0]”,
“UiPath.Mail.Activities”: “[1.24.14]”,
“UiPath.MicrosoftOffice365.Activities”: “3.0.10”,
“UiPath.System.Activities”: “25.12.2”,
“UiPath.Testing.Activities”: “[24.10.4]”,
“UiPath.UIAutomation.Activities”: “24.10.1”
},
When I executed I got this error

UiPath.IntegrationService.Activities.Runtime.Exceptions.RuntimeException: Request failed with error: 
RequestId : 69cb4c1ee4b09ad5910ef335
Message : You need to pass either Message body or Adaptive card JSON or Image or Sharepoint file IDs

Status code: BadRequest. Error code: DAP-RT-1101.   at UiPath.IntegrationService.Activities.Runtime.Services.ExecutionService.SendMultipartRequestAsync(String requestUri, ExecutionParameters executionParameters, HttpMethod httpMethod, String multipartName, ICollection`1 jitInputs, CancellationToken token, Dictionary`2 telemetryUsedProperties)
   at UiPath.IntegrationService.Activities.Runtime.Services.ExecutionService.ExecuteOperationAsync(ExecutionParameters executionParameters, ConnectorActivityConfiguration activityConfiguration, Dictionary`2 telemetryUsedProperties, CancellationToken token)
   at UiPath.IntegrationService.Activities.Runtime.Activities.ConnectorActivity.ExecuteAsync(AsyncCodeActivityContext context, CancellationToken token)
   at UiPath.IntegrationService.Activities.Runtime.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
   at UiPath.IntegrationService.Activities.Runtime.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
   at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Kindly assist. Thanks.

@RobinsonFrancis

As per the error message (Message : You need to pass either Message body or Adaptive card JSON or Image or Sharepoint file IDs),

you can pass only one at a time that Message body or Image or SharePoint file id. And per you screenshot, you are using multiple properties (Message, File Ids) at once. If you want send all these then pass it using saperate activities.

Hope it helps.

I have already passed the File IDs


Although the variable name is uploadedFileUrls,it is having FILE ids of the files uploaded in SharePoint.
Has this got to do with the properties

Because it says “either” so I have put the File IDs while emptying the Adaptive card and the message fields. Still I am hitting the same error.
If we populate the File IDs field and the Message Body fields together, only the text message appears.

Can someone help me with this?

Hi @RobinsonFrancis,

Can you try it with just one image first?

Thanks

I have tried it with one image. And that works fine. Both message and image are displayed in the Chat


.
Below is the screenshot of the configuration of the Send Channel Message activity

It seems that the File IDs field is being ignored.

Hi @RobinsonFrancis,

You can try the following approach:

  • First, test with one File ID and remove the message body.
    • Use: {“FileID”}
  • If it works, then try with multiple File IDs:
    • Use: {“FileID1”, “FileID2”}

This will help verify whether the issue is related to multiple inputs or payload structure.

Thanks

I have tried that too


.After running it, all I see is the message alone without the image
image

@RobinsonFrancis

to ensure we are doing it correct

click on plus near file ids field and then open advanced editor

that is where try to specify one file ID and check

cheers

Hi @RobinsonFrancis ,

Can you use the below File ID format:

6B37C62879---****-***********

You can get this from File URL.

Thanks

I get this URL from the copy URL function next to the file in the Sharepoint:
Sign in to your account.
How do I get the url you mean?

Hi,

For testing purpose open the file in Browser then need to copy the highlighted id:

image

If works then implement the following:

  • Use Upload File (SharePoint / Office 365 activity)
  • After upload, capture the output response
  • The response contains file metadata, including the Id (File ID)

Thanks

I have still not been able to pass the picture, is it the way I populate the File IDs field. Can someone take a look at the


workflow. Please let me know if there is a need for more information.

Hi @RobinsonFrancis,

Can you try the following for multiple files:

“file1ID,file2ID,file3ID”

Thanks