How to use dynamic content with webhook to MS Teams?

Elisa Klahsen 20 Reputation points
2024-03-22T20:25:32.4833333+00:00

We are using a webhook to notify us when an azure synapse pipeline fails.
It works fine when just text is in the body of the webook.

User's image

However, I would like the body to have dynamic content; specifically pipeline parameters. But when I do, the json changes and I can't override the type: expression.

User's image

How do I use the "add dynamic content" correctly so I don't get an error like "Expression of type: 'String' does not match the field: 'body'. Expected type is 'object'."? When I run the job with the webhook set up like the right side, it just spins and never sends the message to Teams.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,916 questions
{count} votes

Accepted answer
  1. Harishga 5,990 Reputation points Microsoft Vendor
    2024-03-26T04:31:35.5566667+00:00

    Hi @Elisa Klahsen
    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer .
    Ask:
    how to correctly use dynamic content with a webhook to Microsoft Teams without getting an error related to the JSON format. Specifically, the user wants to include pipeline parameters in the body of the webhook.

    Solution:
    We got this figured out!

    Add the json in the body field as text. DO NOT use the dynamic content link.
    User's image

    Do not use the dynamic content link. Seems very counterintuitive.
    User's image Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Elisa Klahsen 20 Reputation points
    2024-03-25T18:33:59.4233333+00:00

    We got this figured out!

    Add the json in the body field as text. DO NOT use the dynamic content link

    User's image

    Do not use the dynamic content link. Seems very counterintuitive.

    User's image


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.