Recommended way to restart a form

I am using form to gather a few information to find out an item, user is looking for; such as item name, brand, color, and many more features. after user enters the items for form, the form is submitted, which does an API request to find a item. If API returns an item, i send it to the user, otherwise, I wish to ask user if they want to change the order.

In case they want to change order, the change can be for any combination of parameter. What is the best way to handle this situation. I can reset all the slots and start over, but this may not be an elegant enough solution.

Thank you, Abhishek

@ashek1520 Heya! If API request have an error while fetching the data? What is the possible measure for the same?

Even server is down, where the data is fetched?

If server is down, then the bot can’t do anything other than intimating user that “the server is down, please try after sometime later”

I am looking for solution, where user wants to change the form parameters, I am not sure what is a good way to do it. This situation can arise, irrespective of whether the bot has found an item or not. One bot returns an item, user might ask for another item.

@ashek1520 The approach for this is to create the form with the slot of the item user looking for, fetch the data from APIs, show to him. If agreed fine, else you need to only update the one he want to change whilst using tracker and sent to API again on that item (as the nature of API is JSON) so you need to write the code for that, it basically validation check. I hope you get this point!

Thanks Nik for your quick reply.

I am not clear yet. If there is any example, It will greatly help. here is what I understand:

create the form with the slot of the item user looking for

this is what I am doing, created form with slots will describe the item, color, shape, brand, etc.

show API response, and show to user, if changes are required, update only what he wants while using tracker.

I did not get this point, any example or pseudo code will be useful. When I did API request, the form is submitted, so I need to start form again. How do I ask to update what user wants to change?

validation check (I guess you meant form validation) works only if the form is active, the API request is sent, when form is submitted.

It is quite possible that I am thinking in complete different direction :frowning: and missing a simple logic.

@ashek1520 I had seen one example video but now I am unable to find that video. In that video user confirm the value (which user input) and then bot show and user change one specific value and again show for confirmation. Rasa is so wide now days so many examples. I will try my best to share the video of that, that how to change/update the slot value (not using API). Meanwhile, you can build some steps whilst using API.