Help to get Assessment sysid from server to pass it to client in Action type ESC to-dos page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 10:39 PM
Hello All,
I am working on one button (close with Survey) in ESC to-dos page. I am getting Assessment sysid in the server script and I want to use it(pass it) in the client side URL. This is being used in the Action type. Could you please assist.Below is the code I have used.
Note:If i pass the exact url of survey the page is redirecting and after submitting the survey,the ticket is getting closed.i want to do it in a dynamic way by passing assessment sysid.I tried using $scope and data aswell.
Server side:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 10:50 PM
how are you getting that sysId in server side?
you can access the URL itself in client side and get the sysId if it's present in url parameter
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 11:45 PM - edited 04-27-2025 11:55 PM
Thanks for your response.
Below is the URL I am trying to make dynamic,in that the last parameter is sysid where I am getting in server code highlighted(in orange).
But when I tried to call that URL from server to client I am stuck,data and $scope.data are not working or I am missing something!!
URL:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 11:58 PM
why not get the URL in client side and get sysId from there
var url = window.location.href;
// then get the sysId from that URL using string manipulation
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2025 10:35 PM
I tried doing that aswell.That is giving current url i.e ESC page url.But I need assessment sys_id in that URL which will not generate until I click on the button.
I tried by using Glide Ajax,data object and also $scope like we use in widgets but since it is different configuration i.e Action type,it's not working.
Is there a way in the Action type to call the server variable in Client?
Correct me if I am wrong!!