How to control Sequence response after submitting a form
After submitting form inputs data to a Convertigo Sequence, for example, you may want to check and warn the user if the process has succeeded or if it went wrong.
Under the Call_sequence component placed in the onSubmit event of your form, use the IfElse and doElse components to control the Sequence response and display a message to warn the user.
In the condition property of the IfElse component you can check for the presence or not of a certain key or value in the sequence’s response.
For example, to check there is no key ‘error’ in the response write the following:
!parent.out.error
![](../__attachments/32735259/image-20231219-113846.png?inst-v=1a90f070-fe26-41dc-931e-98c768b55d69)
If the condition returns true, all child components will be executed. A Toast component in our case.
In the doElse component, you can use an Alert component, in case there was an error.
![](../__attachments/32735259/reset_form_inputs-20231219-111703.gif?inst-v=1a90f070-fe26-41dc-931e-98c768b55d69)
You may have a look at the sample project here : https://github.com/convertigo/c8oprj-sample-form-submit Ready to import in your Convertigo Studio