botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Cards alongside FormFlow

Open rohanbadlani opened this issue 10 years ago • 13 comments

Hi,

I was wondering if Cards can be used alongside FormFlow (using the Dialog Flow of FormFlow except the adding customized cards for each Form Field?) If yes, can someone please point me to documentation related to it or any example using it?

Regards, Rohan

rohanbadlani avatar Aug 29 '16 05:08 rohanbadlani

I believe you can use title/subtitle/image but not full cards:

https://github.com/Microsoft/BotBuilder/commit/e06eb46e5aaaa816fda31eb120871e0d63cd3132

@msft-shahins @chrimc62 can you use cards in FormFlow?

willportnoy avatar Aug 29 '16 22:08 willportnoy

By default the extended information in DescribeAttribute should generate cards for you. You can also override the IFormBuilder.Prompter with your own implementation of PromptAsyncDelegate which can do any mapping you like.

chrimc62 avatar Sep 09 '16 22:09 chrimc62

Hi I'm very new to bot framework.

We wanted to add custom cards in our formflow. Is there any guide to do that.

So far I've trace PromptAsyncDelegate but I do not know what to do next. form.Prompter = new PromptAsyncDelegate(IDialogContext Context, FormPrompt Microsoft.Bot.Builder.Dialogs.Internals.Prompt, T State, IField < T > File) => { };

Am I doing this right?

Appreciate your expertise.

nitecloack avatar Feb 24 '17 11:02 nitecloack

You should probably not need to replace the prompter unless you need to do some kind of custom card generation. Just look at the attributes of DescribeAttribute and fill those in appropriately, i.e. [Describe(Image=, Title="cool stuff", ...]

If you did need to replace the prompter, in your builder you should call .Prompter(). As to your delegate, if you have the latest SDK this is the default prompter. async (context, prompt, state, field) => { var preamble = context.MakeMessage(); var promptMessage = context.MakeMessage(); if (prompt.GenerateMessages(preamble, promptMessage)) { await context.PostAsync(preamble); } await context.PostAsync(promptMessage); return prompt; }; Tweak as you wish.

chrimc62 avatar Feb 24 '17 18:02 chrimc62

Appreciate your quick response.

Yes I'm trying to create a custom card that can run through the form flow.

I get an error trying to use that in the prompter, is seem to get alot of errors.

FormBuilder<UserProfileForm> formbuilder = new FormBuilder<UserProfileForm>();
formbuilder.Prompter(async (context, prompt, state, field) =>
{
var preamble = context.MakeMessage();
var promptMessage = context.MakeMessage();
if (prompt.GenerateMessages(preamble, promptMessage))
{
await context.PostAsync(preamble);
}
await context.PostAsync(promptMessage);
return prompt;
});

nitecloack avatar Feb 27 '17 02:02 nitecloack

@nitecloack can you open a new issue with the error you see? feel free to reference this issue.

willportnoy avatar Feb 28 '17 02:02 willportnoy

What's the status for this? Can we display cards using FORM Flow? I wanted to show a card when i ask for confirmation, Is that possible?

rohantare avatar Jul 06 '17 13:07 rohantare

@rohantare Are you still trying to set this up? I set this up for my own bot the other day.

Tapptastic avatar Oct 30 '17 13:10 Tapptastic

@Tapptastic can you post your implementation as it may help others?

JasonSowers avatar Oct 30 '17 16:10 JasonSowers

@Tapptastic @rohantare Were you able to display a card or an image in the .Confirm of the FormBuilder? I can't figure it out

XopherDesign avatar Feb 03 '18 01:02 XopherDesign

@XopherDesign Let me find my implementation for you and post the code :)

Tapptastic avatar Feb 05 '18 09:02 Tapptastic

Thanks @Tapptastic looking forward to it :)

XopherDesign avatar Feb 05 '18 20:02 XopherDesign

@Tapptastic - I don't see a follow on comment here with your implementation. Can you please post the link? Thanks!

richross avatar Jul 03 '18 16:07 richross