Now mobile redirect to specific record from action item script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2024 09:11 AM
Hello ServiceNow community!
I am trying to achieve the following functionality in ServiceNow mobile.
I have a button that maps to a function on a calendar component.
I want this button to redirect to a record screen with the sys id parameter to be returned from an action item script (i will use GlideRecord to get the currently in progress record).
I haven't found any documentation about it whatsoever. I can't even find if its possible to redirect from script instead of the Action Type Navigation (we have tested this it doesn't fit our use case)
If anyone knows something id be glad for the assist!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 06:23 AM
There is no formal documentation on how to do this but they do have it in an example.
Here is the snippet from the documentation:
(function WriteBackAction(parm_input, parm_variable, actionResult) {
var gr = new GlideRecord('incident');
gr.get(parm_variable['sys_id']);
gr.short_description = 'Updated by Scripted Action';
gs.addInfoMessage(gs.getMessage("This is the First success message"));
gs.addInfoMessage(gs.getMessage("This is the Second success message"));
gs.addInfoMessage(gs.getMessage("This is the Third success message"));
gr.update();
// The below line is what you need.
actionResult.setRedirectionInfo(gr.getUniqueValue(), gr.getTableName());
// The above line is what you need.
})(parm_input, parm_variable, actionResult);
I think this will only work if the Action item has a Input form screen associated with it. Otherwise the `WriteBackAction` function parameters will only have `input`.
I also have the following set to true on the Function record that invokes the Action item but I haven't tested exactly what is required:
- Jump to screen after successful action completion
- Jump to screen without user interaction
- Auto-populate screen parameters
Link to latest version of doc:
https://www.servicenow.com/docs/csh?topicname=sg-studio-create-action-item.html&version=latest
