- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 12:07 PM - edited 10-27-2023 12:09 PM
Hi everyone ,
im trying to pass values from one form to another using a UI action in the context menu, but all of the related fields are not being populated only the strings , is there a way to do this ?
here is the code
var urlStart = '/rm_story.do?sysparm_stack=rm_story.do&sys_id=-1&sysparm_query=';
var url = urlStart + 'u_related_requested_item=' + current.number
+ '^description =' + 'ServiceNow Platform'
action.setRedirectURL(url);
thanks a lot
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 12:51 PM
I believe the Display vlaue for product table is number. Try passing number corresponding to the 'SerivceNow Platform' product and it should work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 12:14 PM
Hi @Waru,
Use below script for your requirement
var urlStart = '/rm_story.do?sysparm_stack=rm_story.do&sys_id=-1&sysparm_query=';
var u_related_requested_item = current.number;
var description = 'ServiceNow Platform';
var url = urlStart + 'u_related_requested_item=' + u_related_requested_item + '^description=' + description;
action.setRedirectURL(url);
Please mark it as solution proposed and helpful if it serves your purpose.
Thanks,
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 12:16 PM
Hi Anand ,
tried the code above but it still doesn't populate the field u_related_request which is a related field , but the description is being populated succesfully

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 12:23 PM
If it is a Reference field try below
var urlStart = '/rm_story.do?sysparm_stack=rm_story.do&sys_id=-1&sysparm_query=';
var url = urlStart + 'u_related_requested_item=' + current.sys_id
+ '^description =' + 'ServiceNow Platform'
action.setRedirectURL(url);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 12:25 PM - edited 10-27-2023 12:26 PM
worked like a charm , how would i use this with other related fields that are not the sysid? for example i have a field called program which should i write directly a string to ?