Emit Submit button without closing the form


I need to instance.emit(‘submitButton’); (Which is what happens when you click on Submit button in Formio) without closing the form.

It’s basically like what happens when you’ve got closeOnSubmit = false with a button Action Submit.

If I go Action Click button with instance.emit(‘submitButton’);, the form will close even with closeOnSubmit = false;

Any way to stop this from happening?

The reason I can’t use the standard button submit event is because I need to issue two Actions:
instance.emit(‘updateData’, {defaultscreen:2});|

I was thinking about overriding submitButton:
formio.on(‘submitButton’, function(res) { /your code here/
But I don’t know what the code would be.

If you’re thinking I could do similar things from the Do block, there are reasons why it can’t be from the Do block.


This submit button action is important because it’s then that the values get updated in the form in the Do block. You could argue that I could set defaultscreen in the Do block but, again, there are reasons why it can’t be so (do block takes a long time to run in my case because I’ve got something there that takes half a minute to run but I need to update defaultscreen immediately)

The answer is
instance.emit(‘updateData’, {defaultscreen:2});|
instance.emit(‘executeDoBlock’, instance.component);

Which means go to screen number two on your form and then execute the Do block.
Thanks goes to UiPath engineering team.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.