Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Mobile App Push Notifications - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Mobile App Push Notifications
KB0622333

Mobile App Push Notifications


12987 Views Last updated : Aug 24, 2022 public Copy Permalink English (Original)
  • English (Original)
  • Japanese
KB Summary by Now Assist

Issue

ServiceNow Mobile App Push Notifications

Overview

This discussion applies to the ServiceNow native mobile apps for iOS and Android. For information on integrating notifications with a custom mobile application, please see Setup Push Notifications for a Custom Push App.

Push notification payloads sent from an instance to the ServiceNow mobile apps support the following attributes:

  • Message: The message text to display in the notification alert.
  • Notification category: An optional category used to determine which predefined actions (buttons) should be displayed and whether the mobile app should be opened in response to an action.
  • Scripts: The script to run when a specific button is tapped. Scripts are stored in the sys_push_notif_act_script table.
  • Record: An optional record to open in response to the notification.
  • Web Path: An optional web path or URL to open in response to the notification. This takes precedence over the record attribute.

Supported Categories

A notification category is used to determine which predefined actions (buttons) should be displayed and whether the mobile app should be opened in response to an action.

Note: Custom button titles are not supported by the ServiceNow mobile apps. A notification category is the only way to specify predefined button titles. Notification categories are not stored on the instance and can not be modified.

The ServiceNow mobile apps support the following categories:

Category IdentifierButton 1 TitleButton 1 IdentifierButton 1 ModeButton 2 TitleButton 2 IdentifierButton 2 Mode
approve_reject_foregroundApproveapprove_foregroundforegroundRejectreject_foregroundforeground
approve_reject_backgroundApproveapprove_backgroundbackgroundRejectreject_backgroundbackground
yes_no_foregroundYesyes_foregroundforegroundNono_foregroundforeground
yes_no_backgroundYesyes_backgroundbackgroundNono_backgroundbackground
accept_decline_foregroundAcceptaccept_foregroundforegroundDeclinedecline_foregroundforeground
accept_decline_backgroundAcceptaccept_backgroundbackgroundDeclinedecline_backgroundbackground

Generating Payloads

Push Notification Message Content records are stored in the sys_push_notif_msg_content table. These records are used to generate push notification payloads. Below are example scripts that demonstrate how to generate payloads with different behavior and buttons.

Record Payload

This payload will open the app to the current record when the notification is opened. The notification will not have any buttons.

(function buildJSON(/*GlideRecord*/ current, /*String*/ message, /*Object*/ attributes) {

    var json = {};

    json = {
        "aps" : {
            "sound" : "default"
        },
        "record" : {
            "table" : current.getTableName(),
            "sys_id" : current.sys_id
        }
    };

    return json;

})(current, message, attributes);

Web Path Payload

This payload will open the app to a custom web path or URL when the notification is opened. The notification will not have any buttons.

(function buildJSON(/*GlideRecord*/ current, /*String*/ message, /*Object*/ attributes) {

    var json = {};

    json = {
        "aps" : {
            "sound" : "default"
        },
        "web_path" : "$vtb.do"
    };

    return json;

})(current, message, attributes);

Approve / Reject Foreground Payload

This payload will open the app to the current record when the notification is opened or a button is tapped. The notification will have "Approve" and "Reject" buttons that will trigger a script in the foreground and cause the app to open.

(function buildJSON(/*GlideRecord*/ current, /*String*/ message, /*Object*/ attributes) {

    var json = {};

    json = {
        "aps" : {
            "sound" : "default",
            "category" : "approve_reject_foreground"
        },
        "record" : {
            "table" : current.getTableName(),
            "sys_id" : current.sys_id
        },
        "scripts" : {"approve_foreground" : "333ecc6253020200601fa3fc9ec58727",
                     "reject_foreground" : "632ecc6253020200601fa3fc9ec58708" }
    };

    return json;

})(current, message, attributes);

Yes / No Background Payload

This payload will open the app to the current record when the notification is opened, but not when a button is tapped. The notification will have "Yes" and "No" buttons that will trigger a script in the background without opening the app.

(function buildJSON(/*GlideRecord*/ current, /*String*/ message, /*Object*/ attributes) {

    var json = {};

    json = {
        "aps" : {
            "sound" : "default",
            "category" : "yes_no_background"
        },
        "record" : {
            "table" : current.getTableName(),
            "sys_id" : current.sys_id
        },
        "scripts" : {"yes_background" : "333ecc6253020200601fa3fc9ec58727",
                     "no_background" : "632ecc6253020200601fa3fc9ec58708" }
    };

    return json;

})(current, message, attributes);

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.