Teams Message Card Input Value Substitution does not provide the inputs

Valasek, Jan 0 Reputation points
2024-07-01T21:09:42.5633333+00:00

Hello,

I am working on integrating a MS Teams Actionable messages via the Webhook with our App.

As part of this I need to collect several inputs from the user and then send the data using the HttpPOST action. As described in https://learn.microsoft.com/en-us/outlook/actionable-messages/message-card-reference#input-value-substitution I want to send the inputs as part of the body. For this I am specifying the following payload for the Actionable Message:

{
  "summary": "Elbonians are coming!",
  "themeColor": "006400",
  "@type": "MessageCard",
  "potentialAction": [
    {
      "@type": "OpenUri",
      "name": "See what they are up to",
      "@context": "http://schema.org/extensions",
      "targets": [
        {
          "os": "default",
          "uri": "https://dilbert.fandom.com/wiki/Elbonia"
        }
      ]
    },
    {
      "@type": "ActionCard",
      "name": "Send them a message",
      "@context": "http://schema.org/extensions",
      "inputs": [
        {
          "isMultiSelect": "false",
          "@type": "MultichoiceInput",
          "id": "messageType",
          "isRequired": "true",
          "title": "What kind of message?",
          "choices": [
            {
              "display": "Nice",
              "value": "nice_message"
            },
            {
              "display": "Nasty",
              "value": "nasty_message"
            }
          ]
        }
      ],
      "actions": [
        {
          "@type": "HttpPOST",
          "name": "Send",
          "target": "https://target.company.com",
          "body": "messageType={{messageType.value}}",
          "headers": [
            {
              "name": "CARD-ACTION-STATUS",
              "value": "TestValue"
            }
          ]
        }
      ]
    }
  ],
  "@context": "http://schema.org/extensions",
  "sections": [
    {
      "activitySubtitle": "ElboCo",
      "activityTitle": "Elbonians are coming",
      "activityImage": "https://static.wikia.nocookie.net/dilbert/images/5/5b/Elbonia.jpg/revision/latest?cb=20150622164352",
      "markdown": true
    }
  ]
}

This produces a nice message exactly as expected:

User's image

The problem is that after filling in the value and executing the HttpPOST action the input field is not injected and the body looks like this, while I would expect the body to be messageType=nasty_value

User's image

I have tried many time different formats of the value injection, however I have always received just the text around, never the value.

Thanks for looking at this.

Jan

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,138 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,268 questions
{count} votes

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.