Can form flow fields in the bot structure be pre-populated?

I used formflow to ask a few questions and finally fill out the form. A unique identifier is generated and provided to the user at the end. Now, using this unique identifier, I want to change the form. Can I pre-populate the fields? Or is there any other way to do this?

This is the code I'm using to create the form for the first time:

public static IForm<AssesmentHelper> BuildForm()
{
    OnCompletionAsyncDelegate<AssesmentHelper> wrapUpRequest = async (context, state) =>
    {
       //Do something....
    };

    return new FormBuilder<AssesmentHelper>()
            .Message(Responses.NumberSelection)
            .Field(nameof(Name))
            .Field(nameof(Age))
            .Field(nameof(Address))
            .Field(nameof(Information))
            .Field(nameof(Email), validate: ValidateMailId)
            .AddRemainingFields()
            .OnCompletion(wrapUpRequest)
            .Build();
}

Now I want to pre-populate the fields (name, age, address) so that I can use it for editing.

+4
source share
2 answers

, / Form FormDialog ( ). . , , .

, ; FormOptions FormOptions.PromptFieldsWithValues ​​, , .

.

+6

, , ,

LUIS, LUIS, , .

 var entities = new List<EntityRecommendation>(result.Entities);
  if (entities.Any(e => e.Type == "IdNumber"))
        {
            entities.Add(new EntityRecommendation(type: "IdNumber") { Entity = entities.FirstOrDefault(e => e.Type == "IdNumber").Entity});
        }

, , . , "" - . "Entity"

+4

Source: https://habr.com/ru/post/1660288/


All Articles