Current Request sys_id on ui action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 02:26 AM
How to get the sys_id of a current request in an ui action which is running on the task table?
Thanks,
Vaishali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 07:23 AM
In my last suggestion I told you to add .toString() at the end of line 8.
Make it: gm.setPreference('req_id', g_form.getUniqueValue().toString());
If I helped you with your case, please click the Thumb Icon and mark as Correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 01:08 AM
@Sebas Di Loreto i tried this but it's not working.
you can see it's coming like this, all the records, but I want to display only the current request's record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2022 08:13 AM
g_form.getUniqueValue() will work on form buttons only.
Is your ui action is form button?
Post full screen shot of ui action.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 01:06 AM
yes it's a form button
but with unique value it's not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 01:13 AM
@Vaishali 11 try changing req_id to sys_id.
It should work.
Please mark as correct answer if this solves your issue
ServiceNow Community Rising Star, Class of 2023