0

I'm having trouble getting my Luis Entities to bind to my FormFlow fields so I can skip steps in the FormFlow. A simplified version of my FormFlow dialog is as follows

[Serializable]
public class DoSearch
{
    public string SearchTerm;

    public static IForm<DoSearch> BuildForm()
    {
        var builder = new FormBuilder<DoSearch>();

        return builder
            .Message("Search Function")
            .Field(nameof(DoSearch.SearchTerm))
            .AddRemainingFields()
            .Confirm("Are you sure you wish to search for {SearchTerm} ?")
            .Build();
    }

}

And I am calling this with the following code

    public async Task StartSearch(IDialogContext context, LuisResult result)
    {

        var searchForm = new BuildForm<DoSearch>(() => DoSearch.BuildForm());
        var searchForm1 = new FormDialog<DoSearch>(new DoSearch(), searchForm , FormOptions.PromptInStart, result.Entities);
        context.Call<searchForm>(searchForm1, SearchComplete);
        // ...
    }

The result.Entities does contain the appropriate entity (Type = SearchTerm) but the FormFlow always asks for this when it runs.

The example Pizza bot sample code seems to work, but I can't seem to get it to bind the entity to the field.

Anyone have any ideas what I'm doing wrong?

Thanks in advance

John Wiseman
  • 3,081
  • 1
  • 22
  • 31
Ian Boggs
  • 522
  • 3
  • 16
  • Hi @Ian_Boggs, could you perhaps share your source on how you mixed LuisDialog with FormFlow in the first place? I'm trying to do the same but have yet to figure out how. – Jasper Apr 21 '16 at 11:28

2 Answers2

0

It appears that this is a bug. Entities seem to bind to properties that are Enums, but that are strings.

https://github.com/Microsoft/BotBuilder/issues/151

Hopefully this will be sorted at some point

Ian Boggs
  • 522
  • 3
  • 16
0

If you get the last version of the SDK it should work.

This has been fixed in this commit : https://github.com/Microsoft/BotBuilder/commit/e81b9dd23b3c69024caf8b53dcddc0bf158f61e2