The confirm action creates a pop-up prior to an action being performed. This usually serves as a safety net for a user attempting either a destructive action or an action that could have other implications for the user, such as asking whether a user wishes to proceed with deleting a record.
This action can also be used as a confirmation to provide feedback after an action has been performed.
The action allows for customizable wording on the confirmation modal and can be set to take place automatically or not.
A confirm action can be set up in various ways:
- You can use it as a confirmation to request confirmation prior to performing an action
- You can use it as a confirmation after an action has successfully been performed
Confirm action with modal
This example has a submit-form action nested inside a confirm action. After pressing the button 'Update employee', a modal will be displayed - here you confirm if you wish to proceed. When confirmed, the submit-form action will proceed.
See the full example of confirm with modal in GitHub.
This example has a confirm action nested inside a submit-form action. When the form is submitted, the confirm action will show a pop-up stating that "Employee was added successfuly". Note that as seen in the image, there is no option to confirm since isConfirmedAutomatically is set to true. But you can see the result of the automatically confirmed action by tapping on "See the confirmation".
See the full example of confirm in GitHub.
See the helper file here.