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
How to handle the adaptive card response in Composer #1820
Comments
@KoradaRajesh As far as I know (@vishwacsena, correct me if I'm wrong), there's no way to capture this through a prompt, since Adaptive Card input is sent through So, you need some way of capturing those. Here's what I did: Adaptive card json: {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Text Input - id: textInput"
},
{
"type": "Input.Text",
"placeholder": "Enter some text",
"id": "textInput"
},
{
"type": "TextBlock",
"text": "Number Input - id: numberInput"
},
{
"type": "Input.Number",
"placeholder": "Enter a number",
"id": "numberInput"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Submit"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
} Then, construct a condition with |
yeah i have tried it but @mdrichardson how do you sent the adaptive card , if we sent in prompts it not accepting the action and again it re prompting if we sent in the (send a response) it will not wait for the submission of card ,it will immediately check the if condition in the flow. |
@KoradaRajesh I had to add it as a separate trigger. It's not ideal and it's difficult to get working in your flow, but that's the only way I was able to do it. If you want to point me to a copy of your bot, I might be able to help you implement it. That being said, the Composer team marked this as an |
Adaptive dialogs automatically promote up adaptive card response as an intent if an |
thank you @mdrichardson and @vishwacsena |
but in composer we can not trigger this as an intent, only .lu format intents it will accept |
@mdrichardson i have tried by triggering an activity on submitting the adaptive card but it's not evaluating |
@KoradaRajesh I used Activity trigger with |
@mdrichardson i have tried both but it throwing an error Did you keep any condition here It's triggering Unknown intent for me |
That takes care of the adaptive card part. The trick is getting it to trigger something else if Here's a link to my repo of this I wasn't able to get this to work in a non-code, Compose-only example. @vishwacsena Is this possible? I tried adding |
@mdrichardson it's working i'm able to get the adaptive card response in activity received trigger but for text message also it's triggering that activity i want to trigger an activity only submitting the adaptive card. |
Hi @KoradaRajesh - Could you please let me know how you have configured the adaptive card json in the bot messages and reading the card in the Flow. I am trying to send an adaptive card but unable to load the JSON. Thanks in Advance. |
@mdrichardson - Could you please let me know how you have added the card JSON in bot messages as i am getting the Syntax error if i add the same json in my bot. PFB the screenshot for your reference. |
I believe you need to format it more like: @adaptivecardjson()
- ```
{
"type"... Note how you need the line: If that doesn't work, please open a new issue. I haven't worked with Composer is awhile and since it's in Preview, things may have changed. |
Is this issue resolved? Can you tell me, how to get the value from action.submit in adaptive card? |
@GowthamDisys see this sample. It shows both using adaptive card to collect input in an input action as well as to route to appropriate dialog. In short, adaptive dialog include a recognizer by default that transforms any payload posted by action.submit into intent + entities. |
@vishwacsena thats a great example.. is there an example for multiple textbox fields from adaptivecard? |
@mganeshphani you can just add additional inputs. Just give them all unique IDs. Then you can access them via an entity
Then you can access the data returned by adaptive card submit via |
@vishwacsena where does the reading part go into? |
If you are asking for one piece of information at a time, you can simply set the If you are collecting multiple pieces of information, then it's better to just use |
Got it.. thanks for the info. i will try.
…On Wed, Sep 9, 2020 at 6:15 PM Vishwac Sena Kannan ***@***.***> wrote:
If you are asking for one piece of information at a time, you can simply
set the value property in the input action to ***@***.***
If you are collecting multiple pieces of information, then it's better to
just use set properties action right after the input to set them to what
ever memory scope you want to set it to. E.g. user.name etc.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1820 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFPMMIEIJQ3KEISUWTHRTJTSFAEC5ANCNFSM4KCFUCNA>
.
--
Ganesh Phani Majeti.
|
I'm still trying to figure out how to collect multiple inputs. The single userName works. Adding an additional field and I keep getting an object error. |
Could you provide an example gathering multiple inputs. This works but for multiple you get an error with object to string conversions. |
@CopenhagenJames as simple as this(this is just a modification of adaptivecardhandling example) |
@vishwacsena thanks for the quick response greatly appreciated |
Sorry, the bot can't talk for a while. It's something the bot's owner needs to address. Error code: 2023. Conversation ID: IT7ZlBeSrMGLRuFHaliH1X-c. Time (UTC): 4/29/2021 9:12:58 AM. Can not convert Object to String. We ran into a problem executing your composer dialog. Can not convert Object to String. |
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.
Describe the bug
Give a clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Give a clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
[bug]
The text was updated successfully, but these errors were encountered: