Actions settings
Last updated
Last updated
© 2024 UI Bakery
You can configure Success or Error toasts for your actions. By default, the Error toast is on, but you can turn it off or modify predefined text. To configure toast settings, select the Final step of the action.
You can also use the action result in the toasts, for example:
Notify about a successful item addition
New customer created {{actions.yourAction.data.id}}
Show an error for a failed action
Action failed with an error {{actions.yourAction.error}}
You might want to create customized error messages that will give your users more clarity about the error. In order to do that, you can use the throw new Error
code and customize the message text.
Let's say you want to throw an error that doesn't allow editing a row in the table on a certain condition.
Create a new action of the JavaScript Code type.
Specify the following code:
If you are using one of the predefined actions (Load Table, Create Row, etc.), then create a multistep action with the JavaScript Code step as the first and the predefined action as the second step.
For the Finish step, navigate to the Error toast, and refer to the error message as {{actions.yourAction.error.message}}
.
Now, anytime the condition is met and the action fails, the user will see a customized error message.
To avoid some actions being executed by mistake, you can configure a confirmation dialog for your users. You will find this setting in the initial Setup step of your action.
In the Setup step of the action, there are also two more additional settings you can configure under the Execution section:
Delay action execution - you can specify the delay before your actions are executed (in ms) to prevent them from running too often.
Preserve action value - if selected, global actions will retain their values, meaning that these values are saved and remain unchanged during page navigations; and the action is not executed again. This feature is particularly useful when you want to store global values that can be reused throughout the user's session. Nonetheless, you have the option to deselect this setting if you prefer the action to refresh its value when you next open the page.