Actionable push notification script example
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.
Important: 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);
Parent Topic:Configure actionable push notifications