show-alert
The action.show-alert provides a way to notify users about important information in your app, you can choose to show the alert as a toast for lightweight updates, or a modal for important messages. Alerts can be customized with styling, icons, and interactive elements, allowing you to tailor them to different scenarios.
The action.show-alert is considered a background action, meaning it can run automatically or silently without interrupting the current flow. It is configurable as a background or secondary action that happens behind the scenes, either as part of other actions or as a result of an action. Background actions typically occur without direct user interaction, such as syncing data, saving changes, uploading files, or refreshing content.
In most cases, show-alert is configured to either run in response to an action within an event such as sync actions configured in an onPress, onFocus, onLoad, or onRefresh,
The alert may not always be triggered directly by the user. Instead, it can be triggered automatically after another action completes. For example, when a user submits a form, the app might attempt to save the data in the background, and if that save fails, action.show-alert is triggered to notify the user of the error.

Example use cases include:
Error handling: Display a retry prompt when a payment fails.
Login feedback: Highlight invalid credentials or missing permissions.
Critical confirmations: Require approval before deleting a record or submitting an expense.
Auto-dismiss functionality for non-critical notifications.
Configuration options
Some properties are common to all actions, see Common action properties for the list of actions and their configuration options.
title
The main heading text displayed at the top of the alert. It should be concise and clearly state the purpose of the message.
presentAs
Specifies how the alert is presented to the user. Options include:
toast(default): For brief, lightweight notifications.modal: For important messages that require attention and may include additional information. Modal alerts are more disruptive since they block the UI and are typically used for critical information.
action
Interactive buttons or controls displayed within the alert let users respond or take specific actions. Use IntelliSense to see the list of available actions.
description
The detailed message content that explains the alert’s purpose, provides instructions, or delivers additional information to the user.
dismiss
Configures how users can dismiss the alert. You can enable a gesture dismissal and set an automatic dismissal time.
autoAfter- specify the number of seconds after which the alert is automatically dismissed. Has no effect whendismissis disabled.isEnabled- When set totrue(default), allowing manual dismissal by swiping down. When set tofalse, the alert cannot be dismissed manually.
group
Grouping allows you to manage multiple alerts under a shared identifier. This ensures that only one alert from a group is visible at a time, preventing alert overload and improving the user experience.
id - Identifier for the alert group. Only one alert per group can be visible at a time. If a new alert with the same group ID is triggered while another is active, the alert will be skipped.
When using modal presentation, alerts with the same groupId are grouped so that only the first alert appears and subsequent ones are automatically skipped. When using the toast presentation, alerts are grouped, preventing duplicates. Users can tap the toast to view details. If multiple alerts exist, they stack and display a count at the top. Swiping left lets users view each alert’s details within the stack.
icon
The icon displayed alongside the alert content provides visual context and helps users recognize the alert’s type or purpose. The alert’s style property determines the icon color. If no style is set, the default isWarning style is applied.
style
Visual styling options let you set the tone of the alert:
isPositive(success/confirmation)isNegative(error) styling to convey the appropriate tone and urgency.isWarning(warning) styling is used by default.
subtitle
Secondary text that appears below the title, providing additional context or supplementary information.
Considerations
The
action.show-alertis configurable as a background or secondary action that executes, either as part of other actions or as a result of an action. Background actions typically occur without direct user interaction, such as syncing data, saving changes, uploading files, or refreshing content. For example, after submitting a form, you could use anonSuccessevent to trigger ashow-alertmessage if a user attempts to perform an operation without completing required prior steps.When the
show-alertis shown as a toast, tap on the toast to view additional details configured in thedescriptionproperty.If multiple alerts are triggered concurrently, they are displayed in layers.
Modalalerts take precedence overtoastalerts and will always appear in the foreground. Anytoastalerts generated at the same time remain hidden until themodalalert is dismissed.
Examples and code snippets
Show-alert as a toast

This example demonstrates an alert configured to display as a toast. It uses a negative style and a custom icon that supports the context of the message. The toast shows the title, subtitle, icon, and available actions at a glance. When the user taps on the toast, the full alert is revealed, including the description field, which can be configured as either static text or dynamically populated using an expression.
Examples:
See the full example in GitHub.
Show-alert as a modal

This example demonstrates an alert configured to display as a modal. It uses a positive style and a custom icon that supports the context of the message. The modal shows the title, subtitle, description, icon, and available actions at a glance. The description field can be configured as either static text or dynamically populated using an expression.
Examples:
See the full example in GitHub.
Show-alert with actions
This example demonstrates how to configure an alert that evaluates a user's app subscription status. If the subscription has expired, an alert is triggered on the onLoad event in the index.jigx file, displaying a message with an action button that prompts the user to provide billing information and subscribe. The alert leverages the action.show-alert , with a condition set through the when property, reading from a custom subscription variable managed in Jigx Management. Importantly, the alert cannot be dismissed as the dismiss: isEnabled is set to false, compelling the user to either subscribe or exit the app.


Show-alert with styling onFocus
This example uses the onFocus event to notify (alert) the salesperson that the sales order requires the customer’s signature. The alert can be displayed as either a toast or a modal and is styled positively, as it serves as an informative reminder rather than an error.
Examples:
See the full example in GitHub.

Show-alert with icons and styling onChange
This example uses the onChange event to alert the worker that the selected tool is unavailable. The alert can be displayed as a toast or a modal and is styled negatively, with a clear icon to reinforce that the selection is not allowed. When shown as a toast, the worker can tap it to view additional details.
Examples:
See the full example in GitHub.


Show-alert with automatic dismissal
This example illustrates how to display a warning alert to workers when specific jobs require PPE (Personal Protective Equipment). Each job is listed with an icon and a "Select" button. Upon selection, if the job necessitates PPE, a non-blocking toast alert appears detailing the required PPE items, reinforcing the importance of safety compliance. The alert is styled with a warning indication and is configured to automatically dismiss after three seconds, ensuring that the alert is noticeable without interrupting the workflow.
Examples:
See the full example in GitHub.


Show-alert with group id
This example demonstrates how to group multiple alerts under a shared identifier, ensuring that only one alert from the group is visible at a time and preventing alert overload.
When a team member taps Start on a work item that is not assigned to them, an Access denied alert is displayed. If the user taps multiple unassigned work items (for example, four in a row), only a single alert message appears because all alerts share the same group identifier.
The alert is presented as a warning toast, making it clearly noticeable while still allowing the user to continue working without interrupting their workflow.
Examples:
See the full example in GitHub.

Show-alert in a REST function
View the code examples in REST errors to learn how to configure the show-alert action in a REST function.
Last updated
Was this helpful?