- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2019 10:06 AM
Hello,
I am looking to auto populate the following fields with a default value in RITM and SCTask
u_category
u_subcategory
cmdb_ci
I used onChange client script but no difference. Below is my script. Please can you help with a better script to achieve this task?
g_form.setValue('u_category', 'Alpha');
g_form.setValue('u_subcategory', 'Bravo');
g_form.setValue('cmdb_ci', 'Charlie');
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2019 11:56 AM
Finally used a Business Rule on sc_req_item and sc_task table and this worked fine.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2019 10:13 AM
Hi there,
Can you explain your question a bit more? Is this on Service Portal, on a Catalog Item for example? Can you also share your complete script. This is not all of it.
If it is just about a Catalog Item, and default value for the variables. Have a look at the variable itself, it contains a field Default value. Or are the value in the script you pasted just an example?
Do look carefully if the field type is string, or reference (in that case you need a sys_id), or select box (in that case you need the value, not the label).
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
LinkedIn
Community article list
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
10-28-2019 10:22 AM
This is for Catalog Item RITM and SCTask form fields. I am working on the script but that is all I have for now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2019 11:56 AM
Finally used a Business Rule on sc_req_item and sc_task table and this worked fine.