Forum Discussion

Piter1200's avatar
Piter1200
Copper Contributor
Feb 17, 2023

Are there any restrictions on the JSON fields for the adaptive cards, type messageBack

Hi! I'm using an adaptive card with content buttons, sending a button with type "messageBack" (I also tried "postBack"), and a JSON set as value. All good, but it looks like some keys get stripped from my JSON value.

 

For example, I'm sending 

{
  "text": "state?",
  "attachmentLayout": "list",
  "attachments": [
    {
      "contentType": "application/vnd.microsoft.card.hero",
      "content": {
        "buttons": [
          {
            "title": "state 1",
            "type": "messageBack",
            "value": "{\"state\":111,\"test2\":2222,\"test3\":333}"
          }
        ]
      }
    }
  ]
}

 

And when the button gets clicked, I get back as value

{
  test2: 2222,
  test3: 333,
}

 

Looks like the "state" key from my JSON got removed. Any ideea why? Or maybe there's a link in the documentation with some keywords? That can't be used? Or I'm doing something wrong here.

 

Thanks!

3 Replies

    • Nivedipa-MSFT's avatar
      Nivedipa-MSFT
      Icon for Microsoft rankMicrosoft
      Piter1200 - We have tested this and able to repro the issue. We have raised a bug for the same. We will let you know once we get any updates on it. Thanks.
      • Nivedipa-MSFT's avatar
        Nivedipa-MSFT
        Icon for Microsoft rankMicrosoft

        Piter1200 - This bug has been fixed now. We have tested this on Teams desktop client version 24137.2216.2931.2440 and we are able to get the state key and value.

         

        Could you please test this and confirm once?

Resources