1

I'd like to create a Bot using the FormFlow with JSON Schema approach. However, I need a bit more flexibility for displaying the answer options, since those need to be whole sentences and not only single words.

Is it possible to extend the enums specified inside the JSON file with descriptions that will be offered as options instead of the enum itself?

As I understand this is possible in code by using the Describe-Attribute.

Thomas
  • 4,030
  • 4
  • 40
  • 79

1 Answers1

0

You could use the "Define" property with custom script. The Sandwich Bot example is doing it this way (from json-schema-example):

"Define": "field.SetType(null).AddDescription(\"cookie\", DynamicSandwich.FreeCookie).AddTerms(\"cookie\", Language.GenerateTerms(DynamicSandwich.FreeCookie, 2)).AddDescription(\"drink\", DynamicSandwich.FreeDrink).AddTerms(\"drink\", Language.GenerateTerms(DynamicSandwich.FreeDrink, 2)); return true;",
Eric Dahlvang
  • 8,252
  • 4
  • 29
  • 50