Bot asks for clarification even on static buttons

I am using BotFramework FormFlow. One of the questions gives a static list of options that the user can choose from. When the user selects Central Us, for example, it still asks for clarification if there is a way to avoid this as it clears what the user has selected. enter image description here

Here's the code:

        [Prompt("Please choose the region in which the cluster should be created {||}")]
    public RegionOptions? DesiredGeoRegion;


    public enum RegionOptions
   {
    AustraliaEast,
    AustraliaSoutheast,
    BrazilSouth,
    CanadaCentral,
    CanadaEast,
    CentralIndia,
    CentralUS,
    EastAsia,
    EastUS,
    EastUS2,
    JapanEast,
    JapanWest,
    NorthCentralUS,
    NorthEurope,
    SouthCentralUS,
    SouthIndia,
    SoutheastAsia,
    UKNorth,
    UKSouth2,
    WestCentralUS,
    WestEurope,
    WestIndia,
    WestUS,
    WestUS2
   }

      

+3


source to share


1 answer


In the documentation, this is the expected behavior as it FormFlow

will try to disambiguate when the entered term is also found in any of the other parameters. In this case, Central US is part of the other options displayed in the second message.

enter image description here

To overcome this, use the Conditions attribute to override the default terms used to map an enumeration value to user input. I tried this and it worked as expected:



public enum RegionOptions
{
    AustraliaEast,
    AustraliaSoutheast,
    BrazilSouth,
    CanadaCentral,
    CanadaEast,
    CentralIndia,
    CentralUS,
    EastAsia,
    EastUS,
    EastUS2,
    JapanEast,
    JapanWest,
    [Terms("North Central US")]
    NorthCentralUS,
    NorthEurope,
    [Terms("South Central US")]
    SouthCentralUS,
    SouthIndia,
    SoutheastAsia,
    UKNorth,
    UKSouth2,
    [Terms("West Central US")]
    WestCentralUS,
    WestEurope,
    WestIndia,
    WestUS,
    WestUS2
}

      

Please note that you will see the same problems with EastUS and WestUS parameters.

+2


source







All Articles