Not able to redirect to request record (incident) on mobile push notification

PrakshalJain
Tera Contributor

Hi,

I’m implementing mobile push notifications for incidents assigned to users in ServiceNow (Yokohama version). The notification is successfully received on the mobile device. However, when tapping the incident number within the push notification, it does not navigate to the specific incident record as expected.


Troubleshooting Steps Taken

  • Reviewed the JSON structure in the official product documentation and referenced a YouTube tutorial. Both indicated that the push message content JSON should include the relevant applet and record reference.

  • In my instance, when configuring the push message, I noticed that no applets are appearing in the navigator to select or reference within the message content, despite building/configuring push notifications and the necessary Mobile UI Builder setups.

    Below is the javascript code:

    (function buildJSON(current, message, attributes) {
     
        var layoutGen = new global.NotificationLayoutFieldGenerator();
        var text_01 = layoutGen.layoutField(current.getTableName(), current.sys_id, "priority");
        var text_02 = layoutGen.layoutField(current.getTableName(), current.sys_id, "state");
        var text_03 = layoutGen.layoutField(current.getTableName(), current.sys_id, "short_description");
     
        var msg_title = "System updates!";
     
        var deepLinkGenerator = new global.MobileDeepLinkGenerator("Request");
        var link = deepLinkGenerator.getFormScreenLink("5120f7c7770101108f64b2487b5a9904", current.getTableName(), current.getValue("sys_id"));
     
        var json = {
            "android_title": msg_title,
            "aps": {
                "alert": {
                    "title": msg_title
                }
            },
            "Link": link,
            "Layout": {
                "Status": text_01,
                "Identifier": text_02,
                "Description": text_03
            }
        };
     
        return json;
     
    })(current, message, attributes);



    Anyone knows this ?


1 ACCEPTED SOLUTION

Sanjay191
Tera Sage

Hi @PrakshalJain 

you need to pass the record screen (like below screen sys_
id ) sys_id at first param of this method     var link = deepLinkGenerator.getFormScreenLink("5120f7c7770101108f64b2487b5a9904", current.getTableName(), current.getValue("sys_id"));

then after it would redirect to particular record screen after tap on the push notification in mobile 
make sure record screen should be correct like if your push notification for the incident then record screen also for  the incident table not for others   

Sanjay191_0-1757650506506.png




If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You!!

View solution in original post

5 REPLIES 5

Sanjay191
Tera Sage

Hi @PrakshalJain 

you need to pass the record screen (like below screen sys_
id ) sys_id at first param of this method     var link = deepLinkGenerator.getFormScreenLink("5120f7c7770101108f64b2487b5a9904", current.getTableName(), current.getValue("sys_id"));

then after it would redirect to particular record screen after tap on the push notification in mobile 
make sure record screen should be correct like if your push notification for the incident then record screen also for  the incident table not for others   

Sanjay191_0-1757650506506.png




If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You!!

Hi @Sanjay191 

I have tried creating a record screen for incident and also tried with pre-existing record screens sys id still its landing on to dashboard home screen on both the screen's sys id

tried in both personal instance as well as in my clients instance

PrakshalJain_0-1757922558327.png

 

PrakshalJain_1-1757922613799.png

PrakshalJain_2-1757922810013.png

 

 

Hi @PrakshalJain 
Did you correctly configure your push notification for the mobile ?
Make sure you scope of the record screen and push notification will in same scope. 
can you please try to create all the configuration in one scope (global).

please refer this as well
https://www.youtube.com/watch?v=mbOubsyQFrw

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You!!


Today David Ha and Fu Ho, ServiceNow Outbound Product Management, showcase how to take advantage of mobile push notifications. We walk through setting up notifications, configuring fields, and applying UI styling. Timestamps: Intro - 0:00 Overview - 2:35 Exercise - 6:42 We are live every other ...

Hi @Sanjay191 
The above has been resolved 
I have to modify the data item script which I was attaching in record screen as per my requirement also the scope of data item has to be in catalog mobile scope irrespective of the record screen scope
but thanks for your guidance.