Actionable push notification script example

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:1分
  • You can use this JSON script example to configure an actionable push notification for ServiceNow® mobile apps.

    Example script

    The following example script creates a push notification that your users can see on their mobile devices.

    重要:
    The globally unique identifier in the following script ("70bbc19c87f901101ae365b83cbb3559") is the sys_id of the push notification record found on the push notification table [sys_sg_push_notification]. Make sure that the identifier in the script your system generates matches the sys_id of your push notification.
    (function buildJSON(/*GlideRecord*/ current, /*String*/ message, /*Object*/ attributes) {
    
         var layoutFields = {"Identifier" : "number", "Description" : "short_description", "Status" : "state" };
           return new global.ActionablePushPayloadBuilder(current, "70bbc19c87f901101ae365b83cbb3559", layoutFields).buildJSON(); 
    
    })(current, message, attributes);