Create push message content

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 4분
  • Push message content specifies additional JSON content in the push notification payload that is sent to the push provider.

    시작하기 전에

    You must know how to use JSON with push messages.

    Role required: admin or push_admin

    주:
    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

    이 태스크 정보

    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.

    프로시저

    1. Navigate to All > System Notification > Push > Push Message Content.
    2. In the Push Notification Message Contents table, click New.
    3. Fill out the fields on the Push Notifications Message Content form (see table).
    4. Click Submit.
      Adding content with JSON
      표 1. Notification Message form fields
      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 can override these attributes. See Create a push message attribute definition for information on creating attributes.

    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;

    다음에 수행할 작업

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