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