Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic retry prompts? #1503

Closed
onchainguy-eth opened this issue Oct 24, 2016 · 6 comments
Closed

Dynamic retry prompts? #1503

onchainguy-eth opened this issue Oct 24, 2016 · 6 comments

Comments

@onchainguy-eth
Copy link

Hi,

is there currently any way to achieve dynamic retry prompts? By dynamic I mean something like providing a function that fetches a retry message from database at runtime and not when the prompt dialog is sent?

@willportnoy
Copy link
Member

In the C# or Node SDK? In both languages, you can create your own dialog that implements any custom logic you want.

@onchainguy-eth
Copy link
Author

In NodeJS. Well I've got the following example:

builder.Prompts.choice(
  session,
  'This is just a random question?',
  'Yes|No',
  { retryPrompt: randomRetry() }
);

The function randomRetry is just evaluated one when starting the prompt so even when the user causes the retry prompt to open many times afterwards he will always get the same text even when the randomRetry function returns different values anytime.

Do you know what I mean?

@palmerabollo
Copy link
Contributor

@seb0zz You can show a random prompt from a list of static values. The SDK allows that. But if you want to go to a database or to generate a really dynamic value, I think you have to do it yourself. I don't know anything in the bot framework SDK to do that. You could set the maxRetries to 0 in the prompt options and handle retries yourself, showing different values.

@onchainguy-eth
Copy link
Author

@palmerabollo I will try that, thanks!

@sagarmodhavaniya
Copy link

builder.Prompts.text(session,"Alright. What is the best phone number for us to reach you?"{retryPrompt:'For better follow i would request you to share your phone number to proceed further.'});
here some line of code for validation number if number is wrong then i am replaceDialog with repromt:true

session.replaceDialog('phoneNumberIntent',{ reprompt: true })

in my example the repromt are not working there is always display Prompt msg
retryPrompt string are not display

@jwiley84
Copy link

jwiley84 commented Jun 28, 2019

This issue is closed. The team does not actively monitor closed issues. In the future, please ask questions on Stack Overflow. The Bot Framework Team prefers to use the GitHub repository for Bug reports and Feature Requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants