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

Adaptive cards $when not actioned by bot framework composer in webchat or emulator #9205

Closed
6 tasks
dweeb1937 opened this issue May 22, 2022 · 2 comments
Closed
6 tasks
Assignees
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete. Type: Bug Something isn't working

Comments

@dweeb1937
Copy link

Describe the bug

I'm using Bot Framework Composer to make a chat bot. When using an adaptive card, json elements should be conditionally hidden when the following exists
"$when": "False"
However that doesn't seem to happen in emulator or webchat.

Is this a bot framework issue?

Version

Version: 2.1.2
Electron: 8.2.4
Chrome: 80.0.3987.165
NodeJS: 12.13.0
V8: 8.0.426.27-electron.0

Browser

  • [ x] Electron distribution
  • Chrome
  • Safari
  • Firefox
  • Edge

OS

  • macOS
  • [x ] Windows 10 pro
  • Ubuntu

To Reproduce

Steps to reproduce the behavior:

  1. Create adaptive card attachment for send response.
  2. Add an textblock saying Hi, and include a $when line set to false.
  3. Run the bot and you'll still see Hi.
  4. You can try setting value of $when to "${1==2}", "False", "false", "FALSE", it will still show.

Expected behavior

Should not see Hi.

Screenshots

Additional context

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.3",
    "body": [
		{
            "type": "TextBlock",
            "text": "Hi 1=2",
            "spacing": "Small",
            "size": "Default",
            "wrap": true,
            "$when": "${1==2}"
        }, 
        {
            "type": "TextBlock",
            "text": "Hi false",
            "spacing": "Small",
            "size": "Default",
            "wrap": true,
            "$when": "false"
        }, 
        {
            "type": "TextBlock",
            "text": "Hi False",
            "spacing": "Small",
            "size": "Default",
            "wrap": true,
            "$when": "False"
        }, 
        {
            "type": "TextBlock",
            "text": "Hi FALSE",
            "spacing": "Small",
            "size": "Default",
            "wrap": true,
            "$when": "FALSE"
        }
	]
}
@dweeb1937 dweeb1937 added Needs-triage A new issue that require triage Type: Bug Something isn't working labels May 22, 2022
@stevkan stevkan added customer-reported Required for internal Azure reporting. Do not delete. Bot Services Required for internal Azure reporting. Do not delete. Do not change color. labels May 23, 2022
@dmvtech
Copy link
Collaborator

dmvtech commented May 23, 2022

Hi @dweeb1937 Thank you for reporting this.

Unfortunately, adaptive card templating is not yet implemented in the SDK.

Please see more info here:

@dmvtech dmvtech closed this as completed May 23, 2022
@dmvtech dmvtech added customer-replied-to Required for internal reporting. Do not delete. and removed Needs-triage A new issue that require triage labels May 23, 2022
@Hemajm
Copy link

Hemajm commented Sep 16, 2022

I'm using Bot Framework Composer for chat bot development.
I am using an adaptive card (Actionset), the particular action must be hidden when the following property exists
"$when": "${showAction == true}"

but it is not working as expected in emulator or webchat. As of the below code it must display one action button but its displaying two buttons.
Please find the below code and screenshot for your reference,

#testAction_form()

"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.3",
"$data":{
    "showAction": true
},
"body": [
    {
        "type": "ActionSet",
        "$when": "${showAction == false}",
        "actions": [
            {
                "id": "action1",
                "type": "Action.Submit",
                "title": "Action 1 processing.."
            }
        ]
    },
    {
        "type": "ActionSet",
     "$when": "${showAction == true}",
        "actions": [
            {
	     "id": "action2",
                "type": "Action.Submit",
                "title": "Action 2 processing.."
            }
        ]
    }
]

Actual Result:

image

Expected:
It must not display the button(Action) if condition not satisfied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-replied-to Required for internal reporting. Do not delete. customer-reported Required for internal Azure reporting. Do not delete. Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants