Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DCR: patch Message Text for submitted Adaptive Cards #5293

Closed
16 tasks
Stevenic opened this issue Feb 11, 2019 · 4 comments
Closed
16 tasks

DCR: patch Message Text for submitted Adaptive Cards #5293

Stevenic opened this issue Feb 11, 2019 · 4 comments
Labels
backlog The issue is out of scope for the current iteration but it will be evaluated in a future release. BF Customer Ask "Convenience" asks made by our customers and don’t accrue to any major feature

Comments

@Stevenic
Copy link
Contributor

Issue

When an AdaptiveCard is submitted via the Submit.Action button, the bot receives an message activity with an empty text field and a value field containing a JSON object with the submitted input field values. The issue is there's no built in way of knowing what button was clicked or what form is being submitted. Developers currently need to add a hidden field to the Submit.Action which they can then use to route the received form data.

Proposed change

We can provide a more general solution to this problem if we update the BotFrameworkAdapter class to detect an incoming AdaptiveCard form (missing text and JSON object in the value field) and then look for a special "message.text" field, in the values JSON object, which we then promote to being the text of the received activity. This will make the Submit.Action behave more like an imBack or postBack card action which can be easily routed within the bot.

Component Impact

Just the BotFrameworkAdapter class.

Tracking Status

Dotnet SDK

  • PR
  • Merged

Javascript SDK

  • PR
  • Merged

Java SDK

  • PR
  • Merged

Python SDK

  • PR
  • Merged

Emulator

  • PR
  • Merged

Samples

  • PR
  • Merged

Docs

  • PR
  • Merged

Tools

  • PR
  • Merged

[dcr]

@v-kydela
Copy link

@Stevenic - This is a great DCR! I have a question and a comment if you don't mind.

  1. It sounds like you are saying the Activity.Text would be populated with a "message.text" value retrieved from Activity.Value. I'm wondering how the "message.text" value would get there. Wouldn't it have to be put in the Adaptive Card just like the hidden field you mentioned that developers currently need to add?
  2. If an adaptive submit action suddenly stopped producing textless messages, this would break bots that are currently checking if a message's text property is null when they respond to submit actions.

@Stevenic
Copy link
Contributor Author

Stevenic commented Feb 12, 2019

  1. It sounds like you are saying the Activity.Text would be populated with a "message.text" value retrieved from Activity.Value. I'm wondering how the "message.text" value would get there. Wouldn't it have to be put in the Adaptive Card just like the hidden field you mentioned that developers currently need to add?

Yes... Developers would need to add a "message.text" hidden field to their adaptive cards so we would need docs and samples that show this in action.

  1. If an adaptive submit action suddenly stopped producing textless messages, this would break bots that are currently checking if a message's text property is null when they respond to submit actions.

The developer would need to update all of their current adaptive cards to include the "message.text" for the behavior to change. Given that it seems highly unlikely anyone currently has cards with a "message.text" field it seems like a pretty low risk change.

@v-kydela
Copy link

Ah, so when you say "Developers currently need to add a hidden field to the Submit.Action" you don't mean that's something that this DCR would change.

@darrenj
Copy link

darrenj commented Mar 7, 2019

This would address a key problem with Bots that leverage Adaptive Cards and remove manual workarounds required to get prompts for example to work.

@gabog gabog added the BF Customer Ask "Convenience" asks made by our customers and don’t accrue to any major feature label Jun 15, 2020
@gabog gabog added this to To Be Groomed in Bot Framework SDK - BF Customer Ask via automation Jun 15, 2020
@gabog gabog moved this from To Be Groomed to Story Backlog in Bot Framework SDK - BF Customer Ask Jun 15, 2020
@gabog gabog added the backlog The issue is out of scope for the current iteration but it will be evaluated in a future release. label Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog The issue is out of scope for the current iteration but it will be evaluated in a future release. BF Customer Ask "Convenience" asks made by our customers and don’t accrue to any major feature
Projects
No open projects
Bot Framework SDK - BF Customer Ask
  
Backlog Feature Rollups
Development

No branches or pull requests

5 participants