question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in Sending Adaptive Card with People Picker to Message

See original GitHub issue

Github issues should be used for bugs and feature requests. Use Stack Overflow for general “how-to” questions.

Version

What package version of the SDK are you using. 4.14.2

Describe the bug

Give a clear and concise description of what the bug is. When sending message using adaptive card that contains a People Picker with dataset, Activity can’t be serialized (FlatterningSerializer throws error):

Caused by: java.lang.ClassCastException: class com.fasterxml.jackson.databind.node.ArrayNode cannot be cast to class com.fasterxml.jackson.databind.node.ObjectNode (com.fasterxml.jackson.databind.node.ArrayNode and com.fasterxml.jackson.databind.node.ObjectNode are in unnamed module of loader ‘app’) at com.microsoft.bot.restclient.serializer.FlatteningSerializer.serialize(FlatteningSerializer.java:187) ~[bot-connector-4.14.2.jar:4.14.2] at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[jackson-databind-2.13.3.jar:2.13.3] … 27 common frames omitted

To Reproduce

Steps to reproduce the behavior: 1 Prepare an adaptive card containing People Picker:

    {
      "type": "Input.ChoiceSet",
      "choices": [],
      "choices.data": {
        "type": "Data.Query",
        "dataset": "graph.microsoft.com/users?scope=currentContext"
      },
      "isMultiSelect": true,
      "placeholder": "Choose at least one person for this feedback",
      "label": "Request to",
      "style": "filtered",
      "id": "userId"
    },
  1. Send card as message
  2. See error in log

Expected behavior

Give a clear and concise description of what you expected to happen. Expect adaptive card to be sent to chat

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here. The same adaptive card works for Task Module. The problem is in FlatterningSerializer, where it tries to flat “choices.data”, how ever, this can’t be done, for the expected flatterned data is:

choices: {
  data: {..}
}

but there’s already a choices: [] existing. These two can’t match.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ramfattahcommented, Jun 30, 2022

Thanks, @johnmiroki, I’m investigating this.

0reactions
tracyboehrercommented, Nov 7, 2022

The root of the problem is the ‘choices.data’ property. It would appear this is a flattened JSON property. I do believe that this should be an object under the ‘choices’ array. It’s a tricky issue and it will take me more research to understand this JSON notation. What the existing FlatteningSerialzier is doing just doesn’t handle it correctly.

In other words, I think a mitigating step is to change the JSON.

Read more comments on GitHub >

github_iconTop Results From Across the Web

People Picker in Adaptive Cards - Teams - Microsoft Learn
In this module, learn how to use the People Picker control in Adaptive Cards, its scenarios and implement people picker.
Read more >
People Picker adaptive element in adaptive cards doesn't ...
Teams for Android just shows "Unable to show options right now" error message. Anything I'm missing or is this a bug on the...
Read more >
Collect response from a user with Adaptive Card in Teams ...
If you run in to an error while submitting the form or triggering the flow, look at the Troubleshooting tips for ...
Read more >
Input.Date - Schema Explorer | Adaptive Cards
Input.Date. Lets a user choose a date. ... errorMessage, string, No, Error message to display when entered input is invalid, 1.3.
Read more >
Using Adaptive Cards - COGNIGY.AI
Submit with an appropriate value. In the example below, clicking on the confirm button will send the text "yes" to your flow, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found