Botframework-composer: Unable to post back values from an adaptive card

Created on 26 Nov 2020  路  9Comments  路  Source: microsoft/BotFramework-Composer

Describe the bug

When an adaptive card contains a submit button and input fields, I am unable to suppress the error message Object reference not set to an instance of an object.

Version

Composer 1.2.2

Browser

N/A. Using Bot Framework Emulator

OS

Windows

To Reproduce

Steps to reproduce the behavior:

  1. Create a new bot
  2. Return the following payload in the Greeting
[Activity
    Attachments = ${json(adaptivecard())}
]
  1. Define the adaptive card as follows in the lu string:
-```{
  "type": "AdaptiveCard",
  "version": "1.0",
  "body": [
    {
      "type": "TextBlock",
      "text": "What is your name",
      "size": "Large"
    },
    {
      "type": "TextBlock",
      "text": "Name"
    },
    {
      "type": "Input.Text",
      "id": "Name"
    }
  ],
  "actions": [
    {
      "type": "Action.Submit",
      "title": "Submit",
      "id": "Submit",
      "data": {
        "CardName": "<cardname>",
        "UserAction": "<submit>"
      }
    },
    {
      "type": "Action.Submit",
      "title": "Cancel",
      "id": "Cancel",
      "data": {
        "CardName": "<cardname>",
        "UserAction": "<cancel>"
      }
    }
  ],
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
  1. Run the bot, observe that when you click the submit message you get an error message Object reference not set to an instance of an object.

Expected behavior

The user should be able to post back the value without the error.

Question: How do I access the value that is posted back?

Bot Services Support Bug customer-replied-to customer-reported

All 9 comments

@jwiley84 just making sure this is on your radar. Please provide an update if possible.

@jwiley84, any update?

I am looking into this.

Hi @knightmeister I'm unable to reproduce this.

No error and it _is_ posting back:

        "channelData": {
          "postBack": true,
          "clientActivityID": "1607638513976l0u4zwomjwp",
          "clientTimestamp": "2020-12-10T22:15:13.976Z"
        },
        "value": {
          "CardName": "<cardname>",
          "UserAction": "<submit>",
          "Name": "Dana"
        }

I assume you do have the template name/identifier for the card (other wise should error in designer), but just to clarify, I'll share exactly what I have:

# SendActivity_e2eRW1()
[Activity
    Attachments = ${json(adaptivecard())}
]

````

adaptivecard

-{ "type": "AdaptiveCard", "version": "1.0", "body": [ { "type": "TextBlock", "text": "What is your name", "size": "Large" }, { "type": "TextBlock", "text": "Name" }, { "type": "Input.Text", "id": "Name" } ], "actions": [ { "type": "Action.Submit", "title": "Submit", "id": "Submit", "data": { "CardName": "<cardname>", "UserAction": "<submit>" } }, { "type": "Action.Submit", "title": "Cancel", "id": "Cancel", "data": { "CardName": "<cardname>", "UserAction": "<cancel>" } } ], "$schema": "http://adaptivecards.io/schemas/adaptive-card.json" }
````

Hi @knightmeister Any further findings on this? Anything I might have missed to be able to reproduce the issue?

Hi @knightmeister Any further findings on this? Anything I might have missed to be able to reproduce the issue?

I'll come back to you in the next day or so. Sorry for my delayed response.

Hey @knightmeister Just checking in again. Sill having this issue?

Closing due to inactivity. Please let us know if you are still having this issue and we can reopen if needed.

@dmvtech I find it ironic that I raised this issue and it sat there unattended for weeks - I'm on Christmas break and I will pick this up on January 7 when I return to work and let you know if it is still an issue then.

Was this page helpful?
0 / 5 - 0 ratings