Actions settings

Each action has a Setup step and a Finish step that contain additional settings you can configure. In this article, we'll explore these steps and their settings in more details.

Setup step settings

Trigger

This section contains automatic action triggers you can turn on/off. You can find more information about them on this page.

Execution

  • Delay action execution for (ms) - 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.

Dialogs

Turn on the Show a confirmation alert before execution toggle and specify your message to configure a confirmation dialog for your users. It may be especially useful when you want to prevent users from executing specific actions by mistake.

Finish step settings

Chain actions

Refer to this page for more information on configuring chain actions.

Toasts

You can configure Success or Error toasts for your actions. The Error toast is on by default.

For each toast, you can modify the message displayed, specify its duration or select the Hide notification only when clicked checkbox.

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}}

Customizing error messages

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. Here's how you can do that:

  1. Create a new action of the JavaScript Code type.

  2. Specify the following code:

if (!{{state.allowRowEdit}}) {
    throw new Error ('Row editing is not allowed')
}
  1. 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.

Last updated

Was this helpful?