How to call UI page from UI action

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 04:20 AM
Hi community,
I have a requirement to create a barcode. I have create one UI page and UI action but not sure how to pass sys_id of current record to UI page. Can someone help me with the same?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 04:26 AM
Hello @Sanket Choughul,
To pass the sys_id of the current record to a UI page, you need to use the sysparm_sys_id parameter in the URL of the UI page. This parameter allows you to pass the sys_id of any record to a UI page and access it in the UI page script. For example, if you have a UI page called barcode and you want to pass the sys_id of the current incident record to it, you can use the following URL:
/barcode.do?sysparm_sys_id=${current.sys_id}
You can use this URL in your UI action script to redirect the user to the UI page when they click on the UI action button. You can use the Redirecting users from a UI action - Product Documentation: Rome - ServiceNow article as a reference for redirecting users from a UI action.
On the UI page script, you can use the RP.getParameter() method to get the value of the sysparm_sys_id parameter and use it for your barcode creation logic. You can use the UI Page - Product Documentation: Rome - ServiceNow article as a reference for creating and scripting UI pages.
For more information about how to pass sys_id of current record to UI page in ServiceNow, you can refer to the following links:
- Fetching a record’s sys_id in a client script - ServiceNow
- [How to get query sys_id of current.sys_id Service Portal (ServiceNow) - Stack Overflow]
- [ServiceNow - Jelly scripting cheatsheet.md · GitHub]
I hope this helps you
Kind Regards,
Swarnadeep Nandy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 04:37 AM - edited 08-16-2023 04:43 AM
Hi Swarnadeep,
I tried by using it by still I am unable to fetch the sys_id of record. For example below is my UI action-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2023 04:40 AM
Hi @Sanket Choughul The below article will help you for the above requirement with code
Cheers, hope that helps
Eswar Chappa
*** Please mark as "Correct" or "Helpful" as appropriate ***