- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 12:15 AM
Hi everyone, I have created a new catalog client script. However, it does not work even though I am just logging in the console. I have checked and not other UI policy runs to counteract this. I will attach the script here.
ps. it works once if I trigger it multiple times
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 12:29 AM
@swesarjann try to add an alert in the client script and run it in incognito window by changed the requested for field. Hopefully it will work as sometimes client script throw issues due to browser caching.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 12:31 AM
Hi @swesarjann
Can you please let us know where you are checking the logs...??
also can you put some alert() in your script to check it.
alert('My message'); //something like this
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 12:58 AM
That's great...!!
Console logs also works...You have to check that in browser console actually like below :
This is my script :
To check browser console >> Right click on page >> Select 'Inspect'
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 12:17 AM
The ending brackets for the onchange function is present, I just couldn`t show in the screenshot

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 12:20 AM
Hi there,
Since you are mentioning it does work when triggered multiple times... can you describe exactly your starting point and how you are testing?
For example, perhaps requested_for is filled onload already? Do share such information as it might be very important to know.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 12:30 AM
Yes, do I test by triggering the script and changing the requested for variable, if I test multiple times I can get it to log to the console once.
The variable also has the default value of the logged in user. I tried testing without the default value but it still doesn`t trigger

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 12:21 AM
@swesarjann This is an onChange script and should run on change of requested_for variable. Are you testing it by updating the values on requested for field? Also, the log will be shown on Browser console.