Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Create push message content

Push message content specifies additional JSON content in the push notification payload that is sent to the push provider.

Before you begin

Complete the following:

  1. Activate push notifications
  2. (iOS only) Upload a push certificate to your instance
  3. Create a push application record for your custom app

You must know how to use JSON with push messages.

Role required: admin or push_admin

Note: This process describes configuration used in the ServiceNow mobile app. Push Notification configuration for the current ServiceNow mobile UI can be found at Mobile push notifications

About this task

Push message content defines the style of push notification that can be sent out for your custom app. You can add custom content, such as a picture, icons, or action buttons for the user to respond to the notification. Use the following variables in the script:

  • current: properties of the current record.
  • message: push message sent as the body of the entire push content.
  • attributes: object of the push message attributes that you define.

Procedure

  1. Navigate to All > System Notification > Push > Push Message Content.

  2. In the Push Notification Message Contents table, select New.

  3. Fill out the fields on the Push Notifications Message Content form (see table).

  4. Select Submit.

Image omitted: mobile-layout.png
Push Notification Message Content form showing the Name, Push app, and Push Message Generation fields with a sample JSON script
|Field|Description|
|-----|-----------|
|Name|Enter a descriptive name for the message content.|
|Push app|The push application the content can be used with.|
|Push Message Generation|Enter a script that determines the message content. See the example scripts.|
|Related list|
|Push Message Attribute Definitions|Select the attributes that apply to this notification. Attributes can be a value or an action. These attributes are used as default values for the content items you create in the content script. However, any attributes you create with the [push message](t_CreateAPushMessage.md) can override these attributes. See [Create a push message attribute definition](t_CreateAPushMessageAttribute.md) for information on creating attributes.|

Example

The following is an example of a content record that creates a two-button layout, one to approve something, such as a change request, and one to decline it.

var json = { 
  "table" : current.getTableName(), 
  "sys_id" : current.sys_id, 
  "template" : { 
    "type": "2 button", 
    "button1" : { 
      "title" : "Approve", 
      "action" : attributes.button_action, 
      "parameters" : { 
        "response" : "approve" 
       } 
     }, 
     "button2" : { 
       "title" : "Decline", 
       "action" : attributes.button_action, 
       "parameters" : { "response" : "decline" 
       } 
     } 
   } 
}; 
json;

What to do next

Define a push message attribute to specify a default push action script or string that you can use in the push message content.