Go back to specific step in waterfall
Hi,
Working with node here!
How can I go back to a specific step in a waterfall ?
The use case is as follow:
Step 1 : The User is prompted to enter a research
Step 2 : No result Found So we go back to step 1
I can't find a way to implement this behavior...
reload the dialog using session.replaceDialog(). This will start you back at the beginning of the waterfall. If your waterfall isn't a separate dialog you should break it out to be a separate dialog.
Yeah I discovered it by myself yesterday ! Hope it will help others!
Thanks for the great work you are doing on this project by the way!
Is there a way to skip a step in a waterfall? Say I have a waterfall where each step promps for some data, but for some run through's I may already have the data needed in some of the steps.
@stephshelley check if the result exists, if it does run next()
may be, you can add a int value to next, to comeback to a previous step or add an index to every step, and, using next(index), we can go back to the step in waterfall
If you want to go backward use a Switch method instead of the waterfall dialog.
@jasonMunsterteiger can you explein please?
You use a Case/Switch statement with If() and control the flow different than with a waterfall dialog. Just check the Case against the client reply and you can start from whatever part in the loop you desire.
Reading his initial question again, I see that you could also use the data validator for dialog prompts and keep trying that same question until it receives the expected data.