How can I pass a URL parameter to the count widget?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2017 10:57 AM
I am using the count widget on a Service Portal page to return the number of open tasks on a custom table extended from Task. I am passing the sys_id of a reference on that table that points to a project table. I want to filter the count on the widget by that field so that I'm showing the number of open tasks for that particular project.
I need it to be dynamic, because the reference will change depending on what project the user selects. So how can I pass the paramter "...&sys_id=<guid>" to the count widget's filter so the count widget will filter on it?
Thank you.
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2017 11:35 AM
How To Get Parameters/Values From a URL in ServiceNow | SN Commander
Using the method mentioned above you would use the Client Script to parse the sysID from the parameter.
Then you would pass the returned value into the server side script. Widget client script
And finally on the server side script have the glide query take in that value as a dynamic variable. Widget server script