BotFramework-Composer icon indicating copy to clipboard operation
BotFramework-Composer copied to clipboard

Prompt with multi-choice: no human readable label available

Open t-yangxi opened this issue 7 years ago • 2 comments

Screen Shot 2019-08-01 at 3 02 49 PM

In current build, label = value (variable name that we use in code, which by the way should not have space in between)

Suggestion: add another field called label. The same could be done to other values like dialog names (we shouldn't have some constraints for dialog names)

t-yangxi avatar Aug 01 '19 22:08 t-yangxi

This can be addressed via enclosing the text with space in quotes ‘pink color’, ‘red color’. The reason is because the case in switch condition is an expression.

{
          "$type": "Microsoft.ChoiceInput",
          "$designer": {
            "name": "Prompt with multi-choice",
            "id": "239306",
            "updatedAt": "2019-09-12T17:40:21.497Z"
          },
          "prompt": "Pick a value",
          "maxTurnCount": 2147483647,
          "property": "$choiceInput",
          "alwaysPrompt": false,
          "allowInterruptions": "notRecognized",
          "outputFormat": "value",
          "choices": [
            {
// Wrap in quotes for string literal
              "value": "'pink color'"
            },
            {
// Wrap in quotes for string literal
              "value": "'red color'"
            }
          ],
          "appendChoices": "true",
          "defaultLocale": "en-us",
          "style": "Auto",
          "choiceOptions": {
            "inlineSeparator": ", ",
            "inlineOr": " or ",
            "inlineOrMore": ", or ",
            "includeNumbers": true
          },
          "recognizerOptions": {
            "noValue": false
          }
        },
        {
          "$type": "Microsoft.SendActivity",
          "$designer": {
            "name": "Send an Activity",
            "id": "037565",
            "updatedAt": "2019-09-12T17:19:29.101Z"
          },
          "activity": "[bfdactivity-037565]"
        },
        {
          "$type": "Microsoft.SwitchCondition",
          "$designer": {
            "name": "Branch: Switch",
            "id": "599489",
            "updatedAt": "2019-09-12T17:20:43.424Z"
          },
          "condition": "$choiceInput",
          "cases": [
            {
// Wrap in quotes for string literal
              "value": "'pink color'",
              "actions": [
                {
                  "$type": "Microsoft.SendActivity",
                  "$designer": {
                    "name": "Send an Activity",
                    "id": "187319",
                    "updatedAt": "2019-09-12T17:20:23.084Z"
                  },
                  "activity": "[bfdactivity-187319]"
                }
              ]
            },
            {
// Wrap in quotes for string literal
              "value": "'red color'",
              "actions": [
                {
                  "$type": "Microsoft.SendActivity",
                  "$designer": {
                    "name": "Send an Activity",
                    "id": "467359",
                    "updatedAt": "2019-09-12T17:20:33.209Z"
                  },
                  "activity": "[bfdactivity-467359]"
                }
              ]
            }
          ]
        }

vishwacsena avatar Sep 12 '19 18:09 vishwacsena

@sangwoohaan

cwhitten avatar Oct 04 '19 23:10 cwhitten